summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/renderer/webplugin_delegate_proxy.cc4
-rw-r--r--skia/ext/platform_canvas.cc16
-rw-r--r--skia/ext/platform_canvas.h17
-rw-r--r--ui/gfx/native_theme_win.cc8
-rw-r--r--ui/gfx/native_theme_win.h10
-rw-r--r--webkit/glue/media/video_renderer_impl.cc10
-rw-r--r--webkit/glue/media/video_renderer_impl.h10
-rw-r--r--webkit/glue/media/web_video_renderer.h4
-rw-r--r--webkit/glue/webmediaplayer_impl.cc3
-rw-r--r--webkit/glue/webmediaplayer_impl.h2
-rw-r--r--webkit/glue/webthemeengine_impl_win.cc40
-rw-r--r--webkit/plugins/npapi/webplugin_delegate_impl_win.cc6
-rw-r--r--webkit/plugins/npapi/webview_plugin.cc10
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc8
-rw-r--r--webkit/plugins/sad_plugin.cc4
15 files changed, 91 insertions, 61 deletions
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index 83d7c8a..617928d 100644
--- a/content/renderer/webplugin_delegate_proxy.cc
+++ b/content/renderer/webplugin_delegate_proxy.cc
@@ -725,7 +725,7 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
// We're using the native OS APIs from here on out.
#if WEBKIT_USING_SKIA
- gfx::NativeDrawingContext context = canvas->beginPlatformPaint();
+ gfx::NativeDrawingContext context = skia::BeginPlatformPaint(canvas);
#elif WEBKIT_USING_CG
gfx::NativeDrawingContext context = canvas;
#endif
@@ -763,7 +763,7 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
}
#if WEBKIT_USING_SKIA
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
#endif
}
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc
index b3577e5..36f0e94 100644
--- a/skia/ext/platform_canvas.cc
+++ b/skia/ext/platform_canvas.cc
@@ -41,4 +41,20 @@ bool PlatformCanvas::initializeWithDevice(SkDevice* device) {
return true;
}
+SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque) {
+ return new PlatformCanvas(width, height, is_opaque);
+}
+
+PlatformDevice::PlatformSurface BeginPlatformPaint(SkCanvas* canvas) {
+ // All of our devices should be our special PlatformDevice.
+ PlatformDevice* device = static_cast<PlatformDevice*>(canvas->getDevice());
+ return device->BeginPlatformPaint();
+}
+
+void EndPlatformPaint(SkCanvas* canvas) {
+ // All of our devices should be our special PlatformDevice.
+ PlatformDevice* device = static_cast<PlatformDevice*>(canvas->getDevice());
+ device->EndPlatformPaint();
+}
+
} // namespace skia
diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h
index 528fd1a..c4d9222 100644
--- a/skia/ext/platform_canvas.h
+++ b/skia/ext/platform_canvas.h
@@ -114,6 +114,23 @@ class SK_API PlatformCanvas : public SkCanvas {
PlatformCanvas& operator=(const PlatformCanvas&);
};
+// Creates a canvas with raster bitmap backing.
+// Set is_opaque if you are going to erase the bitmap and not use
+// transparency: this will enable some optimizations.
+SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque);
+
+// These calls should surround calls to platform drawing routines, the
+// surface returned here can be used with the native platform routines.
+//
+// Call EndPlatformPaint when you are done and want to use skia operations
+// after calling the platform-specific BeginPlatformPaint; this will
+// synchronize the bitmap to OS if necessary.
+//
+// Note: These functions will eventually replace
+// PlatformCanvas::beginPlatformPaint and PlatformCanvas::endPlatformPaint.
+SK_API PlatformDevice::PlatformSurface BeginPlatformPaint(SkCanvas* canvas);
+SK_API void EndPlatformPaint(SkCanvas* canvas);
+
} // namespace skia
#endif // SKIA_EXT_PLATFORM_CANVAS_H_
diff --git a/ui/gfx/native_theme_win.cc b/ui/gfx/native_theme_win.cc
index a118643..ce5f1e1 100644
--- a/ui/gfx/native_theme_win.cc
+++ b/ui/gfx/native_theme_win.cc
@@ -14,8 +14,8 @@
#include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h"
#include "base/win/windows_version.h"
-#include "skia/ext/platform_canvas.h"
#include "skia/ext/skia_utils_win.h"
+#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkShader.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/rect.h"
@@ -540,7 +540,7 @@ HRESULT NativeThemeWin::PaintScrollbarTrack(
int classic_state,
RECT* target_rect,
RECT* align_rect,
- skia::PlatformCanvas* canvas) const {
+ SkCanvas* canvas) const {
HANDLE handle = GetThemeHandle(SCROLLBAR);
if (handle && draw_theme_)
return draw_theme_(handle, hdc, part_id, state_id, target_rect, NULL);
@@ -623,7 +623,7 @@ HRESULT NativeThemeWin::PaintTrackbar(HDC hdc,
int state_id,
int classic_state,
RECT* rect,
- skia::PlatformCanvas* canvas) const {
+ SkCanvas* canvas) const {
// Make the channel be 4 px thick in the center of the supplied rect. (4 px
// matches what XP does in various menus; GetThemePartSize() doesn't seem to
// return good values here.)
@@ -732,7 +732,7 @@ HRESULT NativeThemeWin::PaintProgressBar(HDC hdc,
RECT* value_rect,
bool determinate,
double animated_seconds,
- skia::PlatformCanvas* canvas) const {
+ SkCanvas* canvas) const {
// There is no documentation about the animation speed, frame-rate, nor
// size of moving overlay of the indeterminate progress bar.
// So we just observed real-world programs and guessed following parameters.
diff --git a/ui/gfx/native_theme_win.h b/ui/gfx/native_theme_win.h
index 364e29c..3ec1d55 100644
--- a/ui/gfx/native_theme_win.h
+++ b/ui/gfx/native_theme_win.h
@@ -19,9 +19,7 @@
#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
-namespace skia {
-class PlatformCanvas;
-} // namespace skia
+class SkCanvas;
namespace gfx {
@@ -253,7 +251,7 @@ class NativeThemeWin : public NativeTheme {
int classic_state,
RECT* target_rect,
RECT* align_rect,
- skia::PlatformCanvas* canvas) const;
+ SkCanvas* canvas) const;
// This method is deprecated and will be removed in the near future.
// Paints a scrollbar thumb or gripper.
@@ -296,7 +294,7 @@ class NativeThemeWin : public NativeTheme {
int state_id,
int classic_state,
RECT* rect,
- skia::PlatformCanvas* canvas) const;
+ SkCanvas* canvas) const;
// This method is deprecated and will be removed in the near future.
HRESULT PaintProgressBar(HDC hdc,
@@ -304,7 +302,7 @@ class NativeThemeWin : public NativeTheme {
RECT* value_rect,
bool determinate,
double animated_seconds,
- skia::PlatformCanvas* canvas) const;
+ SkCanvas* canvas) const;
private:
NativeThemeWin();
diff --git a/webkit/glue/media/video_renderer_impl.cc b/webkit/glue/media/video_renderer_impl.cc
index 3bbd626..5e159fe 100644
--- a/webkit/glue/media/video_renderer_impl.cc
+++ b/webkit/glue/media/video_renderer_impl.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.
@@ -49,7 +49,7 @@ void VideoRendererImpl::SetRect(const gfx::Rect& rect) {
}
// This method is always called on the renderer's thread.
-void VideoRendererImpl::Paint(skia::PlatformCanvas* canvas,
+void VideoRendererImpl::Paint(SkCanvas* canvas,
const gfx::Rect& dest_rect) {
scoped_refptr<media::VideoFrame> video_frame;
GetCurrentFrame(&video_frame);
@@ -98,7 +98,7 @@ void VideoRendererImpl::PutCurrentFrame(
// 4. Canvas is opaque.
// TODO(hclam): The fast paint method should support flipping and mirroring.
// Disable the flipping and mirroring checks once we have it.
-bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas,
+bool VideoRendererImpl::CanFastPaint(SkCanvas* canvas,
const gfx::Rect& dest_rect) {
// Fast paint does not handle opacity value other than 1.0. Hence use slow
// paint if opacity is not 1.0. Since alpha = opacity * 0xFF, we check that
@@ -152,7 +152,7 @@ bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas,
}
void VideoRendererImpl::SlowPaint(media::VideoFrame* video_frame,
- skia::PlatformCanvas* canvas,
+ SkCanvas* canvas,
const gfx::Rect& dest_rect) {
// 1. Convert YUV frame to RGB.
base::TimeDelta timestamp = video_frame->GetTimestamp();
@@ -199,7 +199,7 @@ void VideoRendererImpl::SlowPaint(media::VideoFrame* video_frame,
}
void VideoRendererImpl::FastPaint(media::VideoFrame* video_frame,
- skia::PlatformCanvas* canvas,
+ SkCanvas* canvas,
const gfx::Rect& dest_rect) {
DCHECK(video_frame->format() == media::VideoFrame::YV12 ||
video_frame->format() == media::VideoFrame::YV16);
diff --git a/webkit/glue/media/video_renderer_impl.h b/webkit/glue/media/video_renderer_impl.h
index b73c099..b14038b 100644
--- a/webkit/glue/media/video_renderer_impl.h
+++ b/webkit/glue/media/video_renderer_impl.h
@@ -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.
//
@@ -30,7 +30,7 @@ class VideoRendererImpl : public WebVideoRenderer {
// WebVideoRenderer implementation.
virtual void SetWebMediaPlayerImplProxy(WebMediaPlayerImpl::Proxy* proxy);
virtual void SetRect(const gfx::Rect& rect);
- virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
+ virtual void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect);
virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out);
virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame);
@@ -47,18 +47,18 @@ class VideoRendererImpl : public WebVideoRenderer {
private:
// Determine the conditions to perform fast paint. Returns true if we can do
// fast paint otherwise false.
- bool CanFastPaint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
+ bool CanFastPaint(SkCanvas* canvas, const gfx::Rect& dest_rect);
// Slow paint does a YUV => RGB, and scaled blit in two separate operations.
void SlowPaint(media::VideoFrame* video_frame,
- skia::PlatformCanvas* canvas,
+ SkCanvas* canvas,
const gfx::Rect& dest_rect);
// Fast paint does YUV => RGB, scaling, blitting all in one step into the
// canvas. It's not always safe and appropriate to perform fast paint.
// CanFastPaint() is used to determine the conditions.
void FastPaint(media::VideoFrame* video_frame,
- skia::PlatformCanvas* canvas,
+ SkCanvas* canvas,
const gfx::Rect& dest_rect);
void TransformToSkIRect(const SkMatrix& matrix, const gfx::Rect& src_rect,
diff --git a/webkit/glue/media/web_video_renderer.h b/webkit/glue/media/web_video_renderer.h
index efd3109..9e1eed5 100644
--- a/webkit/glue/media/web_video_renderer.h
+++ b/webkit/glue/media/web_video_renderer.h
@@ -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.
@@ -32,7 +32,7 @@ class WebVideoRenderer : public media::VideoRendererBase {
// |dest_rect|.
//
// Method called on the render thread.
- virtual void Paint(skia::PlatformCanvas* canvas,
+ virtual void Paint(SkCanvas* canvas,
const gfx::Rect& dest_rect) = 0;
// Clients of this class (painter/compositor) should use GetCurrentFrame()
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index c01b331..e204be6 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -22,7 +22,6 @@
#include "media/filters/ffmpeg_video_decoder.h"
#include "media/filters/rtc_video_decoder.h"
#include "media/filters/null_audio_renderer.h"
-#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
@@ -124,7 +123,7 @@ WebDataSourceBuildObserverHack* WebMediaPlayerImpl::Proxy::GetBuildObserver() {
return build_observer_.get();
}
-void WebMediaPlayerImpl::Proxy::Paint(skia::PlatformCanvas* canvas,
+void WebMediaPlayerImpl::Proxy::Paint(SkCanvas* canvas,
const gfx::Rect& dest_rect) {
DCHECK(MessageLoop::current() == render_loop_);
if (video_renderer_) {
diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h
index 68b06d5..0a492db 100644
--- a/webkit/glue/webmediaplayer_impl.h
+++ b/webkit/glue/webmediaplayer_impl.h
@@ -102,7 +102,7 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer,
WebDataSourceBuildObserverHack* GetBuildObserver();
// Methods for WebMediaPlayerImpl -> Filter communication.
- void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
+ void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect);
void SetSize(const gfx::Rect& rect);
void Detach();
void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out);
diff --git a/webkit/glue/webthemeengine_impl_win.cc b/webkit/glue/webthemeengine_impl_win.cc
index dd3f356..61e78ca 100644
--- a/webkit/glue/webthemeengine_impl_win.cc
+++ b/webkit/glue/webthemeengine_impl_win.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.
@@ -27,55 +27,55 @@ static RECT WebRectToRECT(const WebRect& rect) {
void WebThemeEngineImpl::paintButton(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
gfx::NativeThemeWin::instance()->PaintButton(
hdc, part, state, classic_state, &native_rect);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintMenuList(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
gfx::NativeThemeWin::instance()->PaintMenuList(
hdc, part, state, classic_state, &native_rect);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintScrollbarArrow(
WebCanvas* canvas, int state, int classic_state,
const WebRect& rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
gfx::NativeThemeWin::instance()->PaintScrollbarArrow(
hdc, state, classic_state, &native_rect);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintScrollbarThumb(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
gfx::NativeThemeWin::instance()->PaintScrollbarThumb(
hdc, part, state, classic_state, &native_rect);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintScrollbarTrack(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect, const WebRect& align_rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
RECT native_align_rect = WebRectToRECT(align_rect);
@@ -83,26 +83,26 @@ void WebThemeEngineImpl::paintScrollbarTrack(
hdc, part, state, classic_state, &native_rect, &native_align_rect,
canvas);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintSpinButton(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
gfx::NativeThemeWin::instance()->PaintSpinButton(
hdc, part, state, classic_state, &native_rect);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintTextField(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect, WebColor color, bool fill_content_area,
bool draw_edges) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
COLORREF c = skia::SkColorToCOLORREF(color);
@@ -111,32 +111,34 @@ void WebThemeEngineImpl::paintTextField(
hdc, part, state, classic_state, &native_rect, c, fill_content_area,
draw_edges);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintTrackbar(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
RECT native_rect = WebRectToRECT(rect);
gfx::NativeThemeWin::instance()->PaintTrackbar(
hdc, part, state, classic_state, &native_rect, canvas);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
void WebThemeEngineImpl::paintProgressBar(
WebCanvas* canvas, const WebRect& barRect, const WebRect& valueRect,
bool determinate, double animatedSeconds)
{
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
+
RECT native_bar_rect = WebRectToRECT(barRect);
RECT native_value_rect = WebRectToRECT(valueRect);
gfx::NativeThemeWin::instance()->PaintProgressBar(
hdc, &native_bar_rect,
&native_value_rect, determinate, animatedSeconds, canvas);
- canvas->endPlatformPaint();
+
+ skia::EndPlatformPaint(canvas);
}
} // namespace webkit_glue
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc
index 9845d2b..ff9c468 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc
+++ b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc
@@ -462,12 +462,12 @@ void WebPluginDelegateImpl::PlatformDestroyInstance() {
}
}
-void WebPluginDelegateImpl::Paint(skia::PlatformCanvas* canvas,
+void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas,
const gfx::Rect& rect) {
if (windowless_) {
- HDC hdc = canvas->beginPlatformPaint();
+ HDC hdc = skia::BeginPlatformPaint(canvas);
WindowlessPaint(hdc, rect);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
}
}
diff --git a/webkit/plugins/npapi/webview_plugin.cc b/webkit/plugins/npapi/webview_plugin.cc
index a67a38b..d1df40f 100644
--- a/webkit/plugins/npapi/webview_plugin.cc
+++ b/webkit/plugins/npapi/webview_plugin.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.
@@ -128,17 +128,15 @@ void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) {
CGContextTranslateCTM(context, rect_.x(), rect_.y());
CGContextSaveGState(context);
#elif WEBKIT_USING_SKIA
- skia::PlatformCanvas* platform_canvas = canvas;
- platform_canvas->translate(SkIntToScalar(rect_.x()),
- SkIntToScalar(rect_.y()));
- platform_canvas->save();
+ canvas->translate(SkIntToScalar(rect_.x()), SkIntToScalar(rect_.y()));
+ canvas->save();
#endif
web_view_->layout();
web_view_->paint(canvas, paintRect);
#if WEBKIT_USING_SKIA
- platform_canvas->restore();
+ canvas->restore();
#elif WEBKIT_USING_CG
CGContextRestoreGState(context);
#endif
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 082d96e..265885c 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1231,7 +1231,7 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
#elif defined(OS_WIN)
// On Windows, we now need to render the PDF to the DC that backs the
// supplied canvas.
- HDC dc = canvas->beginPlatformPaint();
+ HDC dc = skia::BeginPlatformPaint(canvas);
gfx::Size size_in_pixels;
size_in_pixels.set_width(
printing::ConvertUnit(current_print_settings_.printable_area.size.width,
@@ -1253,7 +1253,7 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
current_print_settings_.dpi, current_print_settings_.dpi,
0, 0, size_in_pixels.width(),
size_in_pixels.height(), true, false, true, true);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
#endif // defined(OS_WIN)
return ret;
@@ -1340,7 +1340,7 @@ bool PluginInstance::DrawJPEGToPlatformDC(
return false;
}
- HDC dc = canvas->beginPlatformPaint();
+ HDC dc = skia::BeginPlatformPaint(canvas);
// TODO(sanjeevr): This is a temporary hack. If we output a JPEG
// to the EMF, the EnumEnhMetaFile call fails in the browser
// process. The failure also happens if we output nothing here.
@@ -1359,7 +1359,7 @@ bool PluginInstance::DrawJPEGToPlatformDC(
&compressed_image.front(),
reinterpret_cast<const BITMAPINFO*>(&bmi),
DIB_RGB_COLORS, SRCCOPY);
- canvas->endPlatformPaint();
+ skia::EndPlatformPaint(canvas);
return true;
}
#endif // OS_WIN
diff --git a/webkit/plugins/sad_plugin.cc b/webkit/plugins/sad_plugin.cc
index 7512b4b..c129d34 100644
--- a/webkit/plugins/sad_plugin.cc
+++ b/webkit/plugins/sad_plugin.cc
@@ -38,9 +38,9 @@ void PaintSadPlugin(WebKit::WebCanvas* webcanvas,
// 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_SKIA
- gfx::NativeDrawingContext context = webcanvas->beginPlatformPaint();
+ gfx::NativeDrawingContext context = skia::BeginPlatformPaint(webcanvas);
BlitCanvasToContext(context, plugin_rect, &canvas, gfx::Point(0, 0));
- webcanvas->endPlatformPaint();
+ skia::EndPlatformPaint(webcanvas);
#elif WEBKIT_USING_CG
BlitCanvasToContext(webcanvas, plugin_rect, &canvas, gfx::Point(0, 0));
#endif