diff options
-rw-r--r-- | cc/layer.cc | 5 | ||||
-rw-r--r-- | cc/layer.h | 5 | ||||
-rw-r--r-- | cc/texture_layer.cc | 8 | ||||
-rw-r--r-- | cc/texture_layer.h | 1 | ||||
-rw-r--r-- | cc/tiled_layer.cc | 5 | ||||
-rw-r--r-- | cc/tiled_layer.h | 2 |
6 files changed, 26 insertions, 0 deletions
diff --git a/cc/layer.cc b/cc/layer.cc index d0b3808..2cac222 100644 --- a/cc/layer.cc +++ b/cc/layer.cc @@ -120,6 +120,11 @@ gfx::Rect Layer::layerRectToContentRect(const gfx::RectF& layerRect) const return gfx::ToEnclosingRect(contentRect); } +bool Layer::blocksPendingCommit() const +{ + return false; +} + void Layer::setParent(Layer* layer) { DCHECK(!layer || !layer->hasAncestor(this)); @@ -277,6 +277,11 @@ public: gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const; + // In impl-side painting, this returns true if this layer type is not + // compatible with the main thread running freely, such as a double-buffered + // canvas that doesn't want to be triple-buffered across all three trees. + virtual bool blocksPendingCommit() const; + protected: friend class LayerImpl; friend class TreeSynchronizer; diff --git a/cc/texture_layer.cc b/cc/texture_layer.cc index 2cb8ad7..a00feeb 100644 --- a/cc/texture_layer.cc +++ b/cc/texture_layer.cc @@ -131,4 +131,12 @@ void TextureLayer::pushPropertiesTo(LayerImpl* layer) m_contentCommitted = drawsContent(); } +bool TextureLayer::blocksPendingCommit() const +{ + // Double-buffered texture layers need to be blocked until they can be made + // triple-buffered. Single-buffered layers already prevent draws, so + // can block too for simplicity. + return true; +} + } // namespace cc diff --git a/cc/texture_layer.h b/cc/texture_layer.h index b77ebb0..54dd577 100644 --- a/cc/texture_layer.h +++ b/cc/texture_layer.h @@ -53,6 +53,7 @@ public: virtual bool drawsContent() const OVERRIDE; virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&) OVERRIDE; virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; + virtual bool blocksPendingCommit() const OVERRIDE; protected: explicit TextureLayer(TextureLayerClient*); diff --git a/cc/tiled_layer.cc b/cc/tiled_layer.cc index cbb89bf..b956a2f 100644 --- a/cc/tiled_layer.cc +++ b/cc/tiled_layer.cc @@ -219,6 +219,11 @@ void TiledLayer::pushPropertiesTo(LayerImpl* layer) m_tiler->takeTile((*iter)->i(), (*iter)->j()); } +bool TiledLayer::blocksPendingCommit() const +{ + return true; +} + PrioritizedResourceManager* TiledLayer::resourceManager() const { if (!layerTreeHost()) diff --git a/cc/tiled_layer.h b/cc/tiled_layer.h index fe1270c..aa6703a 100644 --- a/cc/tiled_layer.h +++ b/cc/tiled_layer.h @@ -21,6 +21,8 @@ public: virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; + virtual bool blocksPendingCommit() const OVERRIDE; + virtual bool drawsContent() const OVERRIDE; virtual void setNeedsDisplayRect(const gfx::RectF&) OVERRIDE; |