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

Side by Side Diff: cc/trees/single_thread_proxy.cc

Issue 151093005: cc: Update Main RendererCapabilities on DeferredInitialize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cancel commits with stale caps, no tests yet 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/debug/benchmark_instrumentation.h" 9 #include "cc/debug/benchmark_instrumentation.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } else if (offscreen_context_provider.get()) { 154 } else if (offscreen_context_provider.get()) {
155 offscreen_context_provider->VerifyContexts(); 155 offscreen_context_provider->VerifyContexts();
156 offscreen_context_provider = NULL; 156 offscreen_context_provider = NULL;
157 } 157 }
158 158
159 layer_tree_host_impl_->SetOffscreenContextProvider( 159 layer_tree_host_impl_->SetOffscreenContextProvider(
160 offscreen_context_provider); 160 offscreen_context_provider);
161 } 161 }
162 162
163 OnOutputSurfaceInitializeAttempted(initialized); 163 OnOutputSurfaceInitializeAttempted(initialized);
164 if (initialized) {
165 layer_tree_host_->RendererCapabilitiesChanged();
166 }
164 } 167 }
165 168
166 void SingleThreadProxy::OnOutputSurfaceInitializeAttempted(bool success) { 169 void SingleThreadProxy::OnOutputSurfaceInitializeAttempted(bool success) {
167 LayerTreeHost::CreateResult result = 170 LayerTreeHost::CreateResult result =
168 layer_tree_host_->OnCreateAndInitializeOutputSurfaceAttempted(success); 171 layer_tree_host_->OnCreateAndInitializeOutputSurfaceAttempted(success);
169 if (result == LayerTreeHost::CreateFailedButTryAgain) { 172 if (result == LayerTreeHost::CreateFailedButTryAgain) {
170 // Force another recreation attempt to happen by requesting another commit. 173 // Force another recreation attempt to happen by requesting another commit.
171 SetNeedsCommit(); 174 SetNeedsCommit();
172 } 175 }
173 } 176 }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return; 366 return;
364 367
365 layer_tree_host_impl_->SendManagedMemoryStats( 368 layer_tree_host_impl_->SendManagedMemoryStats(
366 contents_texture_manager->MemoryVisibleBytes(), 369 contents_texture_manager->MemoryVisibleBytes(),
367 contents_texture_manager->MemoryVisibleAndNearbyBytes(), 370 contents_texture_manager->MemoryVisibleAndNearbyBytes(),
368 contents_texture_manager->MemoryUseBytes()); 371 contents_texture_manager->MemoryUseBytes());
369 } 372 }
370 373
371 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } 374 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; }
372 375
376 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() {
377 // Thread-only/Impl-side-painting-only feature. Although it's not impossible
378 // to implement here.
379 NOTREACHED();
380 }
381
373 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { 382 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() {
374 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); 383 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread");
375 // Cause a commit so we can notice the lost context. 384 // Cause a commit so we can notice the lost context.
376 SetNeedsCommitOnImplThread(); 385 SetNeedsCommitOnImplThread();
377 client_->DidAbortSwapBuffers(); 386 client_->DidAbortSwapBuffers();
378 } 387 }
379 388
380 void SingleThreadProxy::DidSwapBuffersOnImplThread() { 389 void SingleThreadProxy::DidSwapBuffersOnImplThread() {
381 client_->DidPostSwapBuffers(); 390 client_->DidPostSwapBuffers();
382 } 391 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 void SingleThreadProxy::DidSwapFrame() { 573 void SingleThreadProxy::DidSwapFrame() {
565 if (next_frame_is_newly_committed_frame_) { 574 if (next_frame_is_newly_committed_frame_) {
566 next_frame_is_newly_committed_frame_ = false; 575 next_frame_is_newly_committed_frame_ = false;
567 layer_tree_host_->DidCommitAndDrawFrame(); 576 layer_tree_host_->DidCommitAndDrawFrame();
568 } 577 }
569 } 578 }
570 579
571 bool SingleThreadProxy::CommitPendingForTesting() { return false; } 580 bool SingleThreadProxy::CommitPendingForTesting() { return false; }
572 581
573 } // namespace cc 582 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698