diff options
author | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 13:46:56 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 13:46:56 +0000 |
commit | 9d611ca0375cf3594423fa8571a30ed356e568f6 (patch) | |
tree | 6e04e592faf658dd786ea2cb1115af7ac7247124 /content/plugin/webplugin_proxy.h | |
parent | bd3db410a3334cbcbd50247306d286326003eb2c (diff) | |
download | chromium_src-9d611ca0375cf3594423fa8571a30ed356e568f6.zip chromium_src-9d611ca0375cf3594423fa8571a30ed356e568f6.tar.gz chromium_src-9d611ca0375cf3594423fa8571a30ed356e568f6.tar.bz2 |
Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend
SkCanvas in any way, other than provide a host of constructors (and delayed constructors
in the form of 'initialize' methods).
These late initializers are a problem, as SkCanvas is deprecating its setDevice() call,
moving to model where the backingstore/device for the canvas must be created before the
canvas is created. This is necessary to allow skia to continue to extend SkCanvas for
its backends (e.g. GPU, PDF, Picture, Pipe, etc.).
The practical change in this CL is to make PlatformCanvas just a typedef for SkCanvas,
and change the call-sites that want to call initialize() to instead create the canvas
using one of the provided Factory functions (e.g. CreatePlatformCanvas). The modifier
Platform is maintained, to document that this canvas may be backed by platform-specific
pixels (e.g. allocated by GDI or cairo).
Review URL: https://codereview.chromium.org/11138024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin/webplugin_proxy.h')
-rw-r--r-- | content/plugin/webplugin_proxy.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/content/plugin/webplugin_proxy.h b/content/plugin/webplugin_proxy.h index a51dc75..7c5e412 100644 --- a/content/plugin/webplugin_proxy.h +++ b/content/plugin/webplugin_proxy.h @@ -27,9 +27,7 @@ #include "ui/surface/transport_dib.h" #include "webkit/plugins/npapi/webplugin.h" -namespace skia { -class PlatformCanvas; -} +class SkCanvas; namespace webkit { namespace npapi { @@ -215,7 +213,7 @@ class WebPluginProxy : public webkit::npapi::WebPlugin { #if defined(OS_WIN) void CreateCanvasFromHandle(const TransportDIB::Handle& dib_handle, const gfx::Rect& window_rect, - SkAutoTUnref<skia::PlatformCanvas>* canvas); + SkAutoTUnref<SkCanvas>* canvas); #elif defined(OS_MACOSX) static void CreateDIBAndCGContextFromHandle( const TransportDIB::Handle& dib_handle, @@ -227,7 +225,7 @@ class WebPluginProxy : public webkit::npapi::WebPlugin { const TransportDIB::Handle& dib_handle, const gfx::Rect& window_rect, scoped_refptr<SharedTransportDIB>* dib_out, - SkAutoTUnref<skia::PlatformCanvas>* canvas); + SkAutoTUnref<SkCanvas>* canvas); static void CreateShmPixmapFromDIB( TransportDIB* dib, @@ -245,7 +243,7 @@ class WebPluginProxy : public webkit::npapi::WebPlugin { return windowless_contexts_[windowless_buffer_index_].get(); } #else - skia::PlatformCanvas* windowless_canvas() const { + SkCanvas* windowless_canvas() const { return windowless_canvases_[windowless_buffer_index_].get(); } @@ -282,7 +280,8 @@ class WebPluginProxy : public webkit::npapi::WebPlugin { base::mac::ScopedCFTypeRef<CGContextRef> windowless_contexts_[2]; scoped_ptr<WebPluginAcceleratedSurfaceProxy> accelerated_surface_; #else - SkAutoTUnref<skia::PlatformCanvas> windowless_canvases_[2]; + SkAutoTUnref<SkCanvas> windowless_canvases_[2]; + SkAutoTUnref<SkCanvas> background_canvas_; #if defined(USE_X11) scoped_refptr<SharedTransportDIB> windowless_dibs_[2]; |