diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 19:35:37 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 19:35:37 +0000 |
commit | 2700dadddb63e42fad2ab8ddfee50386279e2641 (patch) | |
tree | 7ed18b44891af2f3547ba210650efd23d8ec1026 /ui/compositor/compositor.h | |
parent | 64e612ee4be7e308a0708fef6b81171ff5c2d43f (diff) | |
download | chromium_src-2700dadddb63e42fad2ab8ddfee50386279e2641.zip chromium_src-2700dadddb63e42fad2ab8ddfee50386279e2641.tar.gz chromium_src-2700dadddb63e42fad2ab8ddfee50386279e2641.tar.bz2 |
Aura: Have ui::Layer implement WebKit::WebExternalTextureLayerClient
With --ui-enable-threaded-compositing, every Layer::SetExternalTexture() was causing a heavy CCThreadProxy::acquireLayerTextures(). This synchronization is unnecessary on the common case of buffer flips, because RWHVA handles the necessary synchronization via OnCompositingWillStart callbacks.
To reduce the synchronization burden, we handle
- wait for a commit on resize fast ACKS
- handle the common case of buffer flips via WebExternalTextureLayerClient::prepareTexture()
- and explicitly call WebExternalTextureLayer::willModifyTexture() when we need the extra synchronization on tear down.
BUG=136012
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10689108
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor/compositor.h')
-rw-r--r-- | ui/compositor/compositor.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h index 0b129cf..ea57724 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h @@ -101,6 +101,7 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { void set_texture_id(unsigned int id) { texture_id_ = id; } bool flipped() const { return flipped_; } gfx::Size size() const { return size_; } + virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; protected: virtual ~Texture(); @@ -190,6 +191,10 @@ class COMPOSITOR_EXPORT Compositor // and the OnCompositingEnded. bool DrawPending() const { return swap_posted_; } + // Returns whether the drawing is issued from a separate thread + // (i.e. |Compositor::Initialize(true)| was called). + bool IsThreaded() const; + // Internal functions, called back by command-buffer contexts on swap buffer // events. @@ -209,6 +214,7 @@ class COMPOSITOR_EXPORT Compositor float scaleFactor); virtual WebKit::WebGraphicsContext3D* createContext3D(); virtual void didRebindGraphicsContext(bool success); + virtual void didCommit(); virtual void didCommitAndDrawFrame(); virtual void didCompleteSwapBuffers(); virtual void scheduleComposite(); @@ -251,6 +257,8 @@ class COMPOSITOR_EXPORT Compositor int last_ended_frame_; bool disable_schedule_composite_; + + DISALLOW_COPY_AND_ASSIGN(Compositor); }; } // namespace ui |