Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Unified Diff: cc/trees/layer_tree_host.cc

Issue 151093005: cc: Update Main RendererCapabilities on DeferredInitialize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Release Mailbox if UsingSharedMemoryResources changed in TextureLayer::Update Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 5972a9f8303986a65849be5b35357767753d8066..6dc3096b5985c89beda940cda6739805696ac50c 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -67,6 +67,18 @@ RendererCapabilities::RendererCapabilities()
RendererCapabilities::~RendererCapabilities() {}
+bool RendererCapabilities::operator==(const RendererCapabilities& other) const {
+ return best_texture_format == other.best_texture_format &&
+ allow_partial_texture_updates == other.allow_partial_texture_updates &&
+ using_offscreen_context3d == other.using_offscreen_context3d &&
+ max_texture_size == other.max_texture_size &&
+ using_shared_memory_resources == other.using_shared_memory_resources;
+}
+
+bool RendererCapabilities::operator!=(const RendererCapabilities& other) const {
+ return !(*this == other);
+}
+
scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded(
LayerTreeHostClient* client,
SharedBitmapManager* manager,
@@ -178,10 +190,18 @@ void LayerTreeHost::SetLayerTreeHostClientReady() {
proxy_->SetLayerTreeHostClientReady();
}
-static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) {
+static void LayerTreeHostRendererCapabilitiesChanged(Layer* layer) {
+ // TODO(boliu): Rename this to Layer::RendererCapabilitiesChanged.
layer->OnOutputSurfaceCreated();
}
+void LayerTreeHost::RendererCapabilitiesChanged() {
+ if (root_layer()) {
+ LayerTreeHostCommon::CallFunctionForSubtree(
+ root_layer(), base::Bind(&LayerTreeHostRendererCapabilitiesChanged));
+ }
+}
+
LayerTreeHost::CreateResult
LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
TRACE_EVENT1("cc",
@@ -200,12 +220,6 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
contents_texture_manager_->CreateTexture(gfx::Size(), RGBA_8888);
}
- if (root_layer()) {
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer(),
- base::Bind(&LayerTreeHostOnOutputSurfaceCreatedCallback));
- }
-
client_->DidInitializeOutputSurface(true);
return CreateSucceeded;
}

Powered by Google App Engine
This is Rietveld 408576698