summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaryclark@chromium.org <caryclark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 19:37:06 +0000
committercaryclark@chromium.org <caryclark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 19:37:06 +0000
commitf1dbc2b87c692d0d90a221d2672d51d909cb5d9a (patch)
tree2e5728bf1ebb94acf21922a522f0e2128313699d
parent7d0bc38308836f064436c1510318f1437641f07e (diff)
downloadchromium_src-f1dbc2b87c692d0d90a221d2672d51d909cb5d9a.zip
chromium_src-f1dbc2b87c692d0d90a221d2672d51d909cb5d9a.tar.gz
chromium_src-f1dbc2b87c692d0d90a221d2672d51d909cb5d9a.tar.bz2
Convert WebCursor if using Skia on Mac.
When building Chrome for Mac, if WebKit is using Skia as the rendering engine, use an SkBitmap instead of CGImage for the WebCursor. In WebCursor::InitFromCursor, and in WebCusor::InitFromNSCursor, convert the cg_image to a SkBitmap, the WebImage type. This change adds a code path that will be enabled in the future, but does not modify any existing code, so there is no functional change. BUG=79463 TEST=none Review URL: http://codereview.chromium.org/7094009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89879 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webcursor_mac.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm
index d3a6a20..fad30e4 100644
--- a/webkit/glue/webcursor_mac.mm
+++ b/webkit/glue/webcursor_mac.mm
@@ -14,6 +14,10 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
+#if WEBKIT_USING_SKIA
+#include "skia/ext/skia_utils_mac.h"
+#endif
+
using WebKit::WebCursorInfo;
using WebKit::WebImage;
using WebKit::WebSize;
@@ -277,7 +281,11 @@ void WebCursor::InitFromCursor(const Cursor* cursor) {
WebKit::WebCursorInfo cursor_info;
cursor_info.type = WebCursorInfo::TypeCustom;
cursor_info.hotSpot = WebKit::WebPoint(cursor->hotSpot.h, cursor->hotSpot.v);
+#if WEBKIT_USING_SKIA
+ cursor_info.customImage = gfx::CGImageToSkBitmap(cg_image.get());
+#else
cursor_info.customImage = cg_image.get();
+#endif
InitFromCursorInfo(cursor_info);
}
@@ -325,7 +333,11 @@ void WebCursor::InitFromNSCursor(NSCursor* cursor) {
cursor_info.type = WebCursorInfo::TypeCustom;
NSPoint hot_spot = [cursor hotSpot];
cursor_info.hotSpot = WebKit::WebPoint(hot_spot.x, hot_spot.y);
+#if WEBKIT_USING_SKIA
+ cursor_info.customImage = gfx::CGImageToSkBitmap(cg_image);
+#else
cursor_info.customImage = cg_image;
+#endif
} else {
cursor_info.type = WebCursorInfo::TypePointer;
}