0
Files
src/content/renderer/cursor_utils.cc
danakj 0c75ad82c0 Remove WebImage as a concrete type.
WebImage is a wrapper for SkBitmap, which we can just use everywhere
so create and pass around SkBitmaps directly, instead of WebImages.

WebImage only has static methods left then, which are mostly used from
outside of blink, though FromData() is used internally as well, so
it seems it should stay in public/platform/ for now.

Image gains Image::AsSkBitmapForCurrentFrame() as a means to convert
the current frame to an SkBitmap without constructing a WebImage.

R=bauerb@chromium.org, haraken@chromium.org
TBR=jam

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ieb71bde672d1acd84ec36a0e991d9ee44adba718
Reviewed-on: https://chromium-review.googlesource.com/1128365
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573865}
2018-07-10 19:50:12 +00:00

38 lines
1.2 KiB
C++

// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/cursor_utils.h"
#include "build/build_config.h"
#include "content/common/cursors/webcursor.h"
#include "third_party/blink/public/platform/web_cursor_info.h"
using blink::WebCursorInfo;
namespace content {
bool GetWebCursorInfo(const WebCursor& cursor,
WebCursorInfo* web_cursor_info) {
CursorInfo cursor_info;
cursor.GetCursorInfo(&cursor_info);
web_cursor_info->type = cursor_info.type;
web_cursor_info->hot_spot = cursor_info.hotspot;
web_cursor_info->custom_image = cursor_info.custom_image;
web_cursor_info->image_scale_factor = cursor_info.image_scale_factor;
return true;
}
void InitializeCursorFromWebCursorInfo(WebCursor* cursor,
const WebCursorInfo& web_cursor_info) {
CursorInfo cursor_info;
cursor_info.type = web_cursor_info.type;
cursor_info.image_scale_factor = web_cursor_info.image_scale_factor;
cursor_info.hotspot = web_cursor_info.hot_spot;
cursor_info.custom_image = web_cursor_info.custom_image;
cursor->InitFromCursorInfo(cursor_info);
}
} // namespce content