diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-11 19:32:04 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-11 19:32:04 +0000 |
commit | c91f49440d1251103210637f91567849e0ade62a (patch) | |
tree | 2ccbd87b3519bdf2d08c874c448fdeb50c4a7745 /webkit | |
parent | 871da305e61696753db715bf68fedec2b071fde4 (diff) | |
download | chromium_src-c91f49440d1251103210637f91567849e0ade62a.zip chromium_src-c91f49440d1251103210637f91567849e0ade62a.tar.gz chromium_src-c91f49440d1251103210637f91567849e0ade62a.tar.bz2 |
remove WEBKIT_USING_SKIA
WEBKIT_USING_SKIA is always set, so having the #ifdef isn't helpful. This
just removes the guards.
BUG=none
TEST=compiles
Review URL: https://chromiumcodereview.appspot.com/10391041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webcursor_mac.mm | 67 | ||||
-rw-r--r-- | webkit/glue/webthemeengine_impl_mac.cc | 11 | ||||
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc | 2 | ||||
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h | 2 | ||||
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_impl.cc | 2 | ||||
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_impl.h | 2 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_impl.h | 4 |
7 files changed, 3 insertions, 87 deletions
diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm index 1e72e0b..51800cf 100644 --- a/webkit/glue/webcursor_mac.mm +++ b/webkit/glue/webcursor_mac.mm @@ -11,15 +11,12 @@ #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/memory/scoped_nsobject.h" +#include "skia/ext/skia_utils_mac.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" #include "ui/gfx/mac/nsimage_cache.h" -#if WEBKIT_USING_SKIA -#include "skia/ext/skia_utils_mac.h" -#endif - using WebKit::WebCursorInfo; using WebKit::WebImage; using WebKit::WebSize; @@ -96,7 +93,6 @@ CGImageRef CreateCGImageFromCustomData(const std::vector<char>& custom_data, NSCursor* CreateCustomCursor(const std::vector<char>& custom_data, const gfx::Size& custom_size, const gfx::Point& hotspot) { -#if WEBKIT_USING_SKIA // If the data is missing, leave the backing transparent. void* data = NULL; size_t data_size = 0; @@ -122,16 +118,6 @@ NSCursor* CreateCustomCursor(const std::vector<char>& custom_data, else bitmap.eraseARGB(0, 0, 0, 0); NSImage* cursor_image = gfx::SkBitmapToNSImage(bitmap); -#else - base::mac::ScopedCFTypeRef<CGImageRef> cg_image( - CreateCGImageFromCustomData(custom_data, custom_size)); - - scoped_nsobject<NSBitmapImageRep> ns_bitmap( - [[NSBitmapImageRep alloc] initWithCGImage:cg_image.get()]); - scoped_nsobject<NSImage> cursor_image([[NSImage alloc] init]); - DCHECK(cursor_image); - [cursor_image addRepresentation:ns_bitmap]; -#endif // WEBKIT_USING_SKIA NSCursor* cursor = [[NSCursor alloc] initWithImage:cursor_image hotSpot:NSMakePoint(hotspot.x(), @@ -363,13 +349,9 @@ 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 // TODO(avi): build the cursor image in Skia directly rather than going via // this roundabout path. cursor_info.customImage = gfx::CGImageToSkBitmap(cg_image.get()); -#else - cursor_info.customImage = cg_image.get(); -#endif InitFromCursorInfo(cursor_info); } @@ -429,11 +411,7 @@ 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; } @@ -442,49 +420,6 @@ void WebCursor::InitFromNSCursor(NSCursor* cursor) { InitFromCursorInfo(cursor_info); } -#if !WEBKIT_USING_SKIA -void WebCursor::SetCustomData(const WebImage& image) { - if (image.isNull()) - return; - - base::mac::ScopedCFTypeRef<CGColorSpaceRef> cg_color( - CGColorSpaceCreateDeviceRGB()); - - const WebSize& image_dimensions = image.size(); - int image_width = image_dimensions.width; - int image_height = image_dimensions.height; - - size_t size = image_height * image_width * 4; - custom_data_.resize(size); - custom_size_.set_width(image_width); - custom_size_.set_height(image_height); - - // These settings match up with the code in CreateCustomCursor() above; keep - // them in sync. - // TODO(avi): test to ensure that the flags here are correct for RGBA - base::mac::ScopedCFTypeRef<CGContextRef> context( - CGBitmapContextCreate(&custom_data_[0], - image_width, - image_height, - 8, - image_width * 4, - cg_color.get(), - kCGImageAlphaPremultipliedLast | - kCGBitmapByteOrder32Big)); - CGRect rect = CGRectMake(0, 0, image_width, image_height); - CGContextDrawImage(context.get(), rect, image.getCGImageRef()); -} - -void WebCursor::ImageFromCustomData(WebImage* image) const { - if (custom_data_.empty()) - return; - - base::mac::ScopedCFTypeRef<CGImageRef> cg_image( - CreateCGImageFromCustomData(custom_data_, custom_size_)); - *image = cg_image.get(); -} -#endif // !WEBKIT_USING_SKIA - void WebCursor::InitPlatformData() { return; } diff --git a/webkit/glue/webthemeengine_impl_mac.cc b/webkit/glue/webthemeengine_impl_mac.cc index 4ffb6b4..e9b9cf3 100644 --- a/webkit/glue/webthemeengine_impl_mac.cc +++ b/webkit/glue/webthemeengine_impl_mac.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -6,13 +6,10 @@ #include <Carbon/Carbon.h> +#include "skia/ext/skia_utils_mac.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" -#if WEBKIT_USING_SKIA -#include "skia/ext/skia_utils_mac.h" -#endif - using WebKit::WebCanvas; using WebKit::WebRect; using WebKit::WebThemeEngine; @@ -56,12 +53,8 @@ void WebThemeEngineImpl::paintScrollbarThumb( trackInfo.trackInfo.scrollbar.pressState = state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0; trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack); -#if WEBKIT_USING_SKIA gfx::SkiaBitLocker bitLocker(canvas); CGContextRef cgContext = bitLocker.cgContext(); -#else - CGContextRef cgContext = canvas; -#endif HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); } diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index 49c3335..86bee21 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -1597,12 +1597,10 @@ DELEGATE_TO_GL_3(getQueryObjectuivEXT, GetQueryObjectuivEXT, DELEGATE_TO_GL_5(copyTextureCHROMIUM, CopyTextureCHROMIUM, WGC3Denum, WebGLId, WebGLId, WGC3Dint, WGC3Denum) -#if WEBKIT_USING_SKIA GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: onCreateGrGLInterface() { return webkit_glue::CreateCommandBufferSkiaGLBinding(); } -#endif void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { // TODO(kbr): improve the precision here. diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index ffab6a2..9bef4a9 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -480,9 +480,7 @@ class WebGraphicsContext3DInProcessCommandBufferImpl WGC3Denum internal_format); protected: -#if WEBKIT_USING_SKIA virtual GrGLInterface* onCreateGrGLInterface(); -#endif private: // SwapBuffers callback. diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index 0b9bbc9..2f6c6da 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -1676,11 +1676,9 @@ void WebGraphicsContext3DInProcessImpl::copyTextureCHROMIUM( { } -#if WEBKIT_USING_SKIA GrGLInterface* WebGraphicsContext3DInProcessImpl::onCreateGrGLInterface() { return gfx::CreateInProcessSkiaGLBinding(); } -#endif bool WebGraphicsContext3DInProcessImpl::AngleCreateCompilers() { if (!ShInitialize()) diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_impl.h index 43163a4..cc3dc25 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.h @@ -477,9 +477,7 @@ class WebGraphicsContext3DInProcessImpl : public WebGraphicsContext3D { WGC3Denum internal_format); protected: -#if WEBKIT_USING_SKIA virtual GrGLInterface* onCreateGrGLInterface(); -#endif private: bool Initialize(Attributes attributes); diff --git a/webkit/media/webmediaplayer_impl.h b/webkit/media/webmediaplayer_impl.h index 56fe552..272b103 100644 --- a/webkit/media/webmediaplayer_impl.h +++ b/webkit/media/webmediaplayer_impl.h @@ -130,16 +130,12 @@ class WebMediaPlayerImpl // Methods for painting. virtual void setSize(const WebKit::WebSize& size); -#if WEBKIT_USING_SKIA // This variant (without alpha) is just present during staging of this API // change. Later we will again only have one virtual paint(). virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect, uint8_t alpha); -#else - virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); -#endif // True if the loaded media has a playable video/audio track. virtual bool hasVideo() const; |