diff options
author | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 23:31:07 +0000 |
---|---|---|
committer | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 23:31:07 +0000 |
commit | d748d0ffa9996ae58ab39c2cfdd5abbfcb6dcec4 (patch) | |
tree | af8aab17d5d6a08ba69022f408792733471da483 /content/port | |
parent | 89ae13ed038c80228a532f42c92cd5de5bbc8a35 (diff) | |
download | chromium_src-d748d0ffa9996ae58ab39c2cfdd5abbfcb6dcec4.zip chromium_src-d748d0ffa9996ae58ab39c2cfdd5abbfcb6dcec4.tar.gz chromium_src-d748d0ffa9996ae58ab39c2cfdd5abbfcb6dcec4.tar.bz2 |
Change PlatformBitmap memory ownership story. Fix CopyFromBackingStore threading issues.
PlatformBitmap: restructure this class so that, on all platforms,
it is safe to use an SkBitmap derived from the PlatformBitmap
even after the PlatformBitmap is destroyed. In practice
this means changes to Linux (use a different cairo
creation routine that allows us to allocate the memory) and
Windows (the HDC is owned by PlatformBitmap, the HBITMAP
by the SkPixelRef).
CopyFromBackingStore: instead of requiring the caller to
provide a PlatformBitmap, modify the signature so that the
completion callback accepts an SkBitmap. Sometimes, the backing store
copiers will allocate a PlatformBitmap and pass its SkBitmap
to the completion callback, but this becomes merely an
implementation detail. Meanwhile, in the accelerated case,
it is not at all necessary to allocate a PlatformBitmap,
so don't.
This fixes a bug on Linux where the cairo surface context
was being freed on a thread other than the UI thread.
PlatformBitmap is basically not thread safe on Linux,
and this change fixes that. Also fixed is a Dr. Memory
GDI usage warning -- we are sure to de-select the
HBITMAP before deleting the memory DC.
Lastly, moving CopyFromBackingStore's interface to use a
callee-managed SkBitmap conditions the architecture for doing
RGBA->YUV on the GPU, prior to readback.
BUG=109963,159234,161537
Review URL: https://codereview.chromium.org/12087016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180271 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r-- | content/port/browser/render_widget_host_view_port.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h index 70d6b7d..953296c 100644 --- a/content/port/browser/render_widget_host_view_port.h +++ b/content/port/browser/render_widget_host_view_port.h @@ -17,6 +17,7 @@ #include "ui/base/range/range.h" #include "ui/surface/transport_dib.h" +class SkBitmap; class WebCursor; struct AccessibilityHostMsg_NotificationParams; @@ -34,10 +35,6 @@ namespace WebKit { struct WebScreenInfo; } -namespace skia { -class PlatformBitmap; -}; - namespace content { class BackingStore; class SmoothScrollGesture; @@ -164,8 +161,7 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView { virtual void CopyFromCompositingSurface( const gfx::Rect& src_subrect, const gfx::Size& dst_size, - const base::Callback<void(bool)>& callback, - skia::PlatformBitmap* output) = 0; + const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; // Called when accelerated compositing state changes. virtual void OnAcceleratedCompositingStateChange() = 0; |