summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/webview_color_overlay.cc18
-rw-r--r--content/renderer/render_view_impl.cc8
-rw-r--r--content/renderer/webplugin_delegate_proxy.cc4
-rw-r--r--ppapi/shared_impl/private/ppb_browser_font_trusted_shared.cc10
-rw-r--r--ppapi/shared_impl/private/ppb_font_shared.cc10
-rw-r--r--webkit/glue/image_decoder.cc10
-rw-r--r--webkit/glue/webclipboard_impl.cc8
-rw-r--r--webkit/glue/webcursor.cc3
-rw-r--r--webkit/glue/webkit_glue.cc7
-rw-r--r--webkit/media/webmediaplayer_impl.cc54
-rw-r--r--webkit/media/webmediaplayer_impl.h4
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc6
-rw-r--r--webkit/plugins/sad_plugin.cc17
-rw-r--r--webkit/plugins/webview_plugin.cc17
-rw-r--r--webkit/tools/test_shell/mock_webclipboard_impl.cc18
15 files changed, 7 insertions, 187 deletions
diff --git a/chrome/renderer/webview_color_overlay.cc b/chrome/renderer/webview_color_overlay.cc
index d7ae529..e7039f1 100644
--- a/chrome/renderer/webview_color_overlay.cc
+++ b/chrome/renderer/webview_color_overlay.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.
@@ -13,10 +13,6 @@
#include "ui/gfx/size.h"
#include "ui/gfx/skia_util.h"
-#if WEBKIT_USING_CG
-#include "skia/ext/skia_utils_mac.h"
-#endif
-
WebViewColorOverlay::WebViewColorOverlay(content::RenderView* render_view,
SkColor color)
: render_view_(render_view),
@@ -31,20 +27,8 @@ WebViewColorOverlay::~WebViewColorOverlay() {
void WebViewColorOverlay::paintPageOverlay(WebKit::WebCanvas* canvas) {
SkRect rect = gfx::RectToSkRect(gfx::Rect(render_view_->GetSize()));
-
-#if WEBKIT_USING_SKIA
SkPaint paint;
paint.setColor(color_);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawRect(rect, paint);
-#elif WEBKIT_USING_CG
- CGContextSaveGState(canvas);
- CGColorRef color = gfx::SkColorToCGColorRef(color_);
- CGContextSetFillColorWithColor(canvas, color);
- CGColorRelease(color);
- CGContextFillRect(canvas, gfx::SkRectToCGRect(rect));
- CGContextRestoreGState(canvas);
-#else
- NOTIMPLEMENTED();
-#endif
}
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 6a9d750..e852574 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1954,16 +1954,10 @@ void RenderViewImpl::startDragging(const WebDragData& data,
WebDragOperationsMask mask,
const WebImage& image,
const WebPoint& imageOffset) {
-#if WEBKIT_USING_SKIA
- SkBitmap bitmap(image.getSkBitmap());
-#elif WEBKIT_USING_CG
- SkBitmap bitmap = gfx::CGImageToSkBitmap(image.getCGImageRef());
-#endif
-
Send(new DragHostMsg_StartDragging(routing_id_,
WebDropData(data),
mask,
- bitmap,
+ image.getSkBitmap(),
imageOffset));
}
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index d319dbd..edc8550 100644
--- a/content/renderer/webplugin_delegate_proxy.cc
+++ b/content/renderer/webplugin_delegate_proxy.cc
@@ -703,7 +703,6 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
return;
// We're using the native OS APIs from here on out.
-#if WEBKIT_USING_SKIA
if (!skia::SupportsPlatformPaint(canvas)) {
// TODO(alokp): Implement this path.
// This block will only get hit with --enable-accelerated-drawing flag.
@@ -716,9 +715,6 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
skia::ScopedPlatformPaint scoped_platform_paint(canvas);
gfx::NativeDrawingContext context =
scoped_platform_paint.GetPlatformSurface();
-#elif WEBKIT_USING_CG
- gfx::NativeDrawingContext context = canvas;
-#endif
gfx::Rect offset_rect = rect;
offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y());
diff --git a/ppapi/shared_impl/private/ppb_browser_font_trusted_shared.cc b/ppapi/shared_impl/private/ppb_browser_font_trusted_shared.cc
index ab7c45a..0d73691 100644
--- a/ppapi/shared_impl/private/ppb_browser_font_trusted_shared.cc
+++ b/ppapi/shared_impl/private/ppb_browser_font_trusted_shared.cc
@@ -309,15 +309,7 @@ void PPB_BrowserFont_Trusted_Shared::DrawTextToCanvas(
clip->size.width, clip->size.height);
}
-#if WEBKIT_USING_SKIA
- WebCanvas* canvas = destination;
-#elif WEBKIT_USING_CG
- WebCanvas* canvas = skia::GetBitmapContext(skia::GetTopDevice(*destination));
-#else
- NOTIMPLEMENTED();
- return;
-#endif
- font_->drawText(canvas, run, web_position, color, web_clip,
+ font_->drawText(destination, run, web_position, color, web_clip,
PP_ToBool(image_data_is_opaque));
}
diff --git a/ppapi/shared_impl/private/ppb_font_shared.cc b/ppapi/shared_impl/private/ppb_font_shared.cc
index 3918088..36c9ed2 100644
--- a/ppapi/shared_impl/private/ppb_font_shared.cc
+++ b/ppapi/shared_impl/private/ppb_font_shared.cc
@@ -236,15 +236,7 @@ void FontImpl::DrawTextAt(const DrawTextParams& params) {
params.clip->size.width, params.clip->size.height);
}
-#if WEBKIT_USING_SKIA
- WebCanvas* canvas = params.destination;
-#elif WEBKIT_USING_CG
- WebCanvas* canvas = skia::GetBitmapContext(skia::GetTopDevice(*destination));
-#else
- NOTIMPLEMENTED();
- return;
-#endif
- font_->drawText(canvas, run, web_position, params.color, web_clip,
+ font_->drawText(params.destination, run, web_position, params.color, web_clip,
params.image_data_is_opaque == PP_TRUE);
}
diff --git a/webkit/glue/image_decoder.cc b/webkit/glue/image_decoder.cc
index f17d2c1..83b935c 100644
--- a/webkit/glue/image_decoder.cc
+++ b/webkit/glue/image_decoder.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 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.
@@ -9,10 +9,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#if WEBKIT_USING_CG
-#include "skia/ext/skia_utils_mac.h"
-#endif
-
using WebKit::WebData;
using WebKit::WebImage;
@@ -31,11 +27,7 @@ ImageDecoder::~ImageDecoder() {
SkBitmap ImageDecoder::Decode(const unsigned char* data, size_t size) const {
const WebImage& image = WebImage::fromData(
WebData(reinterpret_cast<const char*>(data), size), desired_icon_size_);
-#if WEBKIT_USING_SKIA
return image.getSkBitmap();
-#elif WEBKIT_USING_CG
- return gfx::CGImageToSkBitmap(image.getCGImageRef());
-#endif
}
} // namespace webkit_glue
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc
index 12634ea..b782cd2 100644
--- a/webkit/glue/webclipboard_impl.cc
+++ b/webkit/glue/webclipboard_impl.cc
@@ -24,10 +24,6 @@
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webkit_glue.h"
-#if WEBKIT_USING_CG
-#include "skia/ext/skia_utils_mac.h"
-#endif
-
using WebKit::WebClipboard;
using WebKit::WebData;
using WebKit::WebDragData;
@@ -214,11 +210,7 @@ void WebClipboardImpl::writeImage(
ScopedClipboardWriterGlue scw(client_);
if (!image.isNull()) {
-#if WEBKIT_USING_SKIA
const SkBitmap& bitmap = image.getSkBitmap();
-#elif WEBKIT_USING_CG
- const SkBitmap& bitmap = gfx::CGImageToSkBitmap(image.getCGImageRef());
-#endif
SkAutoLockPixels locked(bitmap);
scw.WriteBitmapFromPixels(bitmap.getPixels(), image.size());
}
diff --git a/webkit/glue/webcursor.cc b/webkit/glue/webcursor.cc
index 94c2781..b55752e 100644
--- a/webkit/glue/webcursor.cc
+++ b/webkit/glue/webcursor.cc
@@ -165,8 +165,6 @@ void WebCursor::Copy(const WebCursor& other) {
CopyPlatformData(other);
}
-#if WEBKIT_USING_SKIA
-// The WEBKIT_USING_CG implementation is in webcursor_mac.mm.
void WebCursor::SetCustomData(const WebImage& image) {
if (image.isNull())
return;
@@ -195,7 +193,6 @@ void WebCursor::ImageFromCustomData(WebImage* image) const {
image->assign(bitmap);
}
-#endif
void WebCursor::ClampHotspot() {
if (!IsCustom())
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index e5a60b6..f2a1205 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -477,14 +477,7 @@ bool ShouldForcefullyTerminatePluginProcess() {
}
WebCanvas* ToWebCanvas(skia::PlatformCanvas* canvas) {
-#if WEBKIT_USING_SKIA
return canvas;
-#elif WEBKIT_USING_CG
- return skia::GetBitmapContext(skia::GetTopDevice(*canvas));
-#else
- NOTIMPLEMENTED();
- return NULL;
-#endif
}
int GetGlyphPageCount() {
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index 04d5c4f..e67a359 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -506,61 +506,7 @@ void WebMediaPlayerImpl::paint(WebCanvas* canvas,
DCHECK_EQ(main_loop_, MessageLoop::current());
DCHECK(proxy_);
-#if WEBKIT_USING_SKIA
proxy_->Paint(canvas, rect, alpha);
-#elif WEBKIT_USING_CG
- // Get the current scaling in X and Y.
- CGAffineTransform mat = CGContextGetCTM(canvas);
- float scale_x = sqrt(mat.a * mat.a + mat.b * mat.b);
- float scale_y = sqrt(mat.c * mat.c + mat.d * mat.d);
- float inverse_scale_x = SkScalarNearlyZero(scale_x) ? 0.0f : 1.0f / scale_x;
- float inverse_scale_y = SkScalarNearlyZero(scale_y) ? 0.0f : 1.0f / scale_y;
- int scaled_width = static_cast<int>(rect.width * fabs(scale_x));
- int scaled_height = static_cast<int>(rect.height * fabs(scale_y));
-
- // Make sure we don't create a huge canvas.
- // TODO(hclam): Respect the aspect ratio.
- if (scaled_width > static_cast<int>(media::limits::kMaxCanvas))
- scaled_width = media::limits::kMaxCanvas;
- if (scaled_height > static_cast<int>(media::limits::kMaxCanvas))
- scaled_height = media::limits::kMaxCanvas;
-
- // If there is no preexisting platform canvas, or if the size has
- // changed, recreate the canvas. This is to avoid recreating the bitmap
- // buffer over and over for each frame of video.
- if (!skia_canvas_.get() ||
- skia_canvas_->getDevice()->width() != scaled_width ||
- skia_canvas_->getDevice()->height() != scaled_height) {
- skia_canvas_.reset(
- new skia::PlatformCanvas(scaled_width, scaled_height, true));
- }
-
- // Draw to our temporary skia canvas.
- gfx::Rect normalized_rect(scaled_width, scaled_height);
- proxy_->Paint(skia_canvas_.get(), normalized_rect);
-
- // The mac coordinate system is flipped vertical from the normal skia
- // coordinates. During painting of the frame, flip the coordinates
- // system and, for simplicity, also translate the clip rectangle to
- // start at 0,0.
- CGContextSaveGState(canvas);
- CGContextTranslateCTM(canvas, rect.x, rect.height + rect.y);
- CGContextScaleCTM(canvas, inverse_scale_x, -inverse_scale_y);
-
- // We need a local variable CGRect version for DrawToContext.
- CGRect normalized_cgrect =
- CGRectMake(normalized_rect.x(), normalized_rect.y(),
- normalized_rect.width(), normalized_rect.height());
-
- // Copy the frame rendered to our temporary skia canvas onto the passed in
- // canvas.
- skia::DrawToNativeContext(skia_canvas_.get(), canvas, 0, 0,
- &normalized_cgrect);
-
- CGContextRestoreGState(canvas);
-#else
- NOTIMPLEMENTED() << "We only support rendering to skia or CG";
-#endif
}
bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const {
diff --git a/webkit/media/webmediaplayer_impl.h b/webkit/media/webmediaplayer_impl.h
index b9b610e..56fe552 100644
--- a/webkit/media/webmediaplayer_impl.h
+++ b/webkit/media/webmediaplayer_impl.h
@@ -310,10 +310,6 @@ class WebMediaPlayerImpl
MediaStreamClient* media_stream_client_;
-#if WEBKIT_USING_CG
- scoped_ptr<skia::PlatformCanvas> skia_canvas_;
-#endif
-
scoped_refptr<media::MediaLog> media_log_;
// Since accelerated compositing status is only known after the first layout,
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 9ea522c..a405e23 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1858,7 +1858,6 @@ PP_Bool PluginInstance::SetCursor(PP_Instance instance,
custom_cursor->hotSpot.x = hot_spot->x;
custom_cursor->hotSpot.y = hot_spot->y;
-#if WEBKIT_USING_SKIA
const SkBitmap* bitmap = image_data->GetMappedBitmap();
// Make a deep copy, so that the cursor remains valid even after the original
// image data gets freed.
@@ -1866,11 +1865,6 @@ PP_Bool PluginInstance::SetCursor(PP_Instance instance,
bitmap->config())) {
return PP_FALSE;
}
-#elif WEBKIT_USING_CG
- // TODO(yzshen): Implement it.
- NOTIMPLEMENTED();
- return false;
-#endif
DoSetCursor(custom_cursor.release());
return PP_TRUE;
diff --git a/webkit/plugins/sad_plugin.cc b/webkit/plugins/sad_plugin.cc
index bc8ef53..ea355ee 100644
--- a/webkit/plugins/sad_plugin.cc
+++ b/webkit/plugins/sad_plugin.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.
@@ -19,19 +19,11 @@ void PaintSadPlugin(WebKit::WebCanvas* webcanvas,
const int width = plugin_rect.width();
const int height = plugin_rect.height();
-#if WEBKIT_USING_SKIA
SkCanvas* canvas = webcanvas;
SkAutoCanvasRestore auto_restore(canvas, true);
// We draw the sad-plugin bitmap at the origin of canvas.
// Add a translation so that it appears at the origin of plugin rect.
canvas->translate(plugin_rect.x(), plugin_rect.y());
-#elif WEBKIT_USING_CG
- // Make a temporary canvas for the background image.
- scoped_ptr<SkCanvas> canvas(skia::CreateBitmapCanvas(width, height, false));
- // Flip the canvas, since the context expects flipped data.
- canvas->translate(0, height);
- canvas->scale(1, -1);
-#endif
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
@@ -42,13 +34,6 @@ void PaintSadPlugin(WebKit::WebCanvas* webcanvas,
sad_plugin_bitmap,
SkIntToScalar(std::max(0, (width - sad_plugin_bitmap.width()) / 2)),
SkIntToScalar(std::max(0, (height - sad_plugin_bitmap.height()) / 2)));
-
- // It's slightly less code to make a big SkBitmap of the sad tab image and
- // then copy that to the screen than to use the native APIs. The small speed
- // penalty is not important when drawing crashed plugins.
-#if WEBKIT_USING_CG
- BlitCanvasToContext(webcanvas, plugin_rect, canvas.get(), gfx::Point(0, 0));
-#endif
}
} // namespace webkit
diff --git a/webkit/plugins/webview_plugin.cc b/webkit/plugins/webview_plugin.cc
index 6ec6ddb..1b0bf8e 100644
--- a/webkit/plugins/webview_plugin.cc
+++ b/webkit/plugins/webview_plugin.cc
@@ -6,6 +6,7 @@
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
+#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
@@ -18,12 +19,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "webkit/glue/webpreferences.h"
-#if WEBKIT_USING_CG
-#include <CoreGraphics/CGContext.h>
-#elif WEBKIT_USING_SKIA
-#include "skia/ext/platform_canvas.h"
-#endif
-
using WebKit::WebCanvas;
using WebKit::WebCursorInfo;
using WebKit::WebDragData;
@@ -127,23 +122,13 @@ void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) {
paintRect.Offset(-rect_.x(), -rect_.y());
-#if WEBKIT_USING_CG
- CGContextRef context = canvas;
- CGContextTranslateCTM(context, rect_.x(), rect_.y());
- CGContextSaveGState(context);
-#elif WEBKIT_USING_SKIA
canvas->translate(SkIntToScalar(rect_.x()), SkIntToScalar(rect_.y()));
canvas->save();
-#endif
web_view_->layout();
web_view_->paint(canvas, paintRect);
-#if WEBKIT_USING_SKIA
canvas->restore();
-#elif WEBKIT_USING_CG
- CGContextRestoreGState(context);
-#endif
}
// Coordinates are relative to the containing window.
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc
index f36e232..e21269a 100644
--- a/webkit/tools/test_shell/mock_webclipboard_impl.cc
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc
@@ -19,11 +19,6 @@
#include "webkit/glue/webkit_glue.h"
#include "webkit/support/webkit_support_gfx.h"
-#if WEBKIT_USING_CG
-#include <ApplicationServices/ApplicationServices.h>
-#include <CoreFoundation/CoreFoundation.h>
-#endif
-
using WebKit::WebDragData;
using WebKit::WebString;
using WebKit::WebURL;
@@ -108,7 +103,6 @@ WebKit::WebData MockWebClipboardImpl::readImage(
std::vector<unsigned char> encoded_image;
// TODO(dcheng): Verify that we can assume the image is ARGB8888. Note that
// for endianess reasons, it will be BGRA8888 on Windows.
-#if WEBKIT_USING_SKIA
const SkBitmap& bitmap = m_image.getSkBitmap();
SkAutoLockPixels lock(bitmap);
webkit_support::EncodeBGRAPNG(static_cast<unsigned char*>(bitmap.getPixels()),
@@ -117,18 +111,6 @@ WebKit::WebData MockWebClipboardImpl::readImage(
bitmap.rowBytes(),
false,
&encoded_image);
-#elif WEBKIT_USING_CG
- CGImageRef image = m_image.getCGImageRef();
- CFDataRef image_data_ref =
- CGDataProviderCopyData(CGImageGetDataProvider(image));
- webkit_support::EncodeBGRAPNG(CFDataGetBytePtr(image_data_ref),
- CGImageGetWidth(image),
- CGImageGetHeight(image),
- CGImageGetBytesPerRow(image),
- false,
- &encoded_image);
- CFRelease(image_data_ref);
-#endif
data.assign(reinterpret_cast<char*>(vector_as_array(&encoded_image)),
encoded_image.size());
return data;