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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2270573002: cc: Get rid of LayerTreeHost::output_surface_lost_ state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-caps
Patch Set: lth-outputsurface-lost: android-build-and-earlyout-sooner Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 if (!visible) { 519 if (!visible) {
520 DCHECK(host_->visible()); 520 DCHECK(host_->visible());
521 521
522 // Make a best effort to try to complete pending readbacks. 522 // Make a best effort to try to complete pending readbacks.
523 // TODO(crbug.com/637035): Consider doing this in a better way, 523 // TODO(crbug.com/637035): Consider doing this in a better way,
524 // ideally with the guarantee of readbacks completing. 524 // ideally with the guarantee of readbacks completing.
525 if (display_.get() && HavePendingReadbacks()) 525 if (display_.get() && HavePendingReadbacks())
526 display_->ForceImmediateDrawAndSwapIfPossible(); 526 display_->ForceImmediateDrawAndSwapIfPossible();
527 527
528 host_->SetVisible(false); 528 host_->SetVisible(false);
529 if (!host_->output_surface_lost()) 529 host_->ReleaseOutputSurface();
530 host_->ReleaseOutputSurface();
531 pending_swapbuffers_ = 0; 530 pending_swapbuffers_ = 0;
532 display_.reset(); 531 display_.reset();
533 } else { 532 } else {
534 host_->SetVisible(true); 533 host_->SetVisible(true);
535 if (output_surface_request_pending_) 534 if (output_surface_request_pending_)
536 HandlePendingOutputSurfaceRequest(); 535 HandlePendingOutputSurfaceRequest();
537 } 536 }
538 } 537 }
539 538
540 void CompositorImpl::setDeviceScaleFactor(float factor) { 539 void CompositorImpl::setDeviceScaleFactor(float factor) {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 794
796 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); 795 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate");
797 host_->SetNeedsAnimate(); 796 host_->SetNeedsAnimate();
798 } 797 }
799 798
800 bool CompositorImpl::HavePendingReadbacks() { 799 bool CompositorImpl::HavePendingReadbacks() {
801 return !readback_layer_tree_->children().empty(); 800 return !readback_layer_tree_->children().empty();
802 } 801 }
803 802
804 } // namespace content 803 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | content/renderer/gpu/render_widget_compositor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698