summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorcaryclark@chromium.org <caryclark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 21:54:07 +0000
committercaryclark@chromium.org <caryclark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 21:54:07 +0000
commitfbdbca3dd3f13c72fdf6482eff48dc24aaff5fe8 (patch)
tree0d901e4633defe66f33527ff987e64513f16d4e6 /webkit/glue
parentea64557971bc55d314f935b026fa7017622167b9 (diff)
downloadchromium_src-fbdbca3dd3f13c72fdf6482eff48dc24aaff5fe8.zip
chromium_src-fbdbca3dd3f13c72fdf6482eff48dc24aaff5fe8.tar.gz
chromium_src-fbdbca3dd3f13c72fdf6482eff48dc24aaff5fe8.tar.bz2
Map webkit glue when Mac build uses Skia.
In webkit_glue::DecodeImage(), the WebImage is of type SkBitmap instead of CGImage, so take the general case if USE_SKIA is defined. The generic version of WebCursor defines SetCustomData and ImageFromCustomData only if WEBKIT_USING_SKIA is enabled, so disable the corresponding routines in the Mac version. In webkit_glue::WebThemeEngineImpl::paintScrollbarThumb(), map the WebCanvas (i.e. SkCanvas) to a CGContext to paint the scrollbar thumb, using the SkiaBitLocker utility class. SkiaBitLocker is described in http://codereview.chromium.org/7031006/ These changes make no functional change to any existing port, so have no new tests. BUG=79463 TEST=none Review URL: http://codereview.chromium.org/6840057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86151 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/webcursor_mac.mm2
-rw-r--r--webkit/glue/webkit_glue.cc2
-rw-r--r--webkit/glue/webthemeengine_impl_mac.cc14
3 files changed, 15 insertions, 3 deletions
diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm
index da80efa..d3a6a20 100644
--- a/webkit/glue/webcursor_mac.mm
+++ b/webkit/glue/webcursor_mac.mm
@@ -334,6 +334,7 @@ void WebCursor::InitFromNSCursor(NSCursor* cursor) {
InitFromCursorInfo(cursor_info);
}
+#if !WEBKIT_USING_SKIA
void WebCursor::SetCustomData(const WebImage& image) {
if (image.isNull())
return;
@@ -374,6 +375,7 @@ void WebCursor::ImageFromCustomData(WebImage* image) const {
CreateCGImageFromCustomData(custom_data_, custom_size_));
*image = cg_image.get();
}
+#endif
void WebCursor::InitPlatformData() {
return;
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index 2749a46..1593c35 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -271,7 +271,7 @@ bool DecodeImage(const std::string& image_data, SkBitmap* image) {
if (web_image.isNull())
return false;
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) && !defined(USE_SKIA)
*image = gfx::CGImageToSkBitmap(web_image.getCGImageRef());
#else
*image = web_image.getSkBitmap();
diff --git a/webkit/glue/webthemeengine_impl_mac.cc b/webkit/glue/webthemeengine_impl_mac.cc
index cafc316..1c49cff 100644
--- a/webkit/glue/webthemeengine_impl_mac.cc
+++ b/webkit/glue/webthemeengine_impl_mac.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -9,6 +9,10 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
+#if WEBKIT_USING_SKIA
+#include "skia/ext/skia_utils_mac.h"
+#endif
+
using WebKit::WebCanvas;
using WebKit::WebRect;
using WebKit::WebThemeEngine;
@@ -52,7 +56,13 @@ void WebThemeEngineImpl::paintScrollbarThumb(
trackInfo.trackInfo.scrollbar.pressState =
state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0;
trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack);
- HIThemeDrawTrack(&trackInfo, 0, canvas, kHIThemeOrientationNormal);
+#if WEBKIT_USING_SKIA
+ gfx::SkiaBitLocker bitLocker(canvas);
+ CGContextRef cgContext = bitLocker.cgContext();
+#else
+ CGContextRef cgContext = canvas;
+#endif
+ HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
}
} // namespace webkit_glue