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

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

Issue 542163003: android: Don't invalidate UI resources if context is lost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 LOG(ERROR) << "Failed to create 3D context for compositor."; 552 LOG(ERROR) << "Failed to create 3D context for compositor.";
553 return scoped_ptr<cc::OutputSurface>(); 553 return scoped_ptr<cc::OutputSurface>();
554 } 554 }
555 555
556 return scoped_ptr<cc::OutputSurface>( 556 return scoped_ptr<cc::OutputSurface>(
557 new OutputSurfaceWithoutParent(context_provider)); 557 new OutputSurfaceWithoutParent(context_provider));
558 } 558 }
559 559
560 void CompositorImpl::OnLostResources() { 560 void CompositorImpl::OnLostResources() {
561 client_->DidLoseResources(); 561 client_->DidLoseResources();
562 ui_resource_provider_.UIResourcesAreInvalid();
563 } 562 }
564 563
565 void CompositorImpl::ScheduleComposite() { 564 void CompositorImpl::ScheduleComposite() {
566 DCHECK(!needs_composite_ || WillComposite()); 565 DCHECK(!needs_composite_ || WillComposite());
567 if (ignore_schedule_composite_) 566 if (ignore_schedule_composite_)
568 return; 567 return;
569 568
570 needs_composite_ = true; 569 needs_composite_ = true;
571 // We currently expect layer tree invalidations at most once per frame 570 // We currently expect layer tree invalidations at most once per frame
572 // during normal operation and therefore try to composite immediately 571 // during normal operation and therefore try to composite immediately
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 644 }
646 645
647 void CompositorImpl::SetNeedsAnimate() { 646 void CompositorImpl::SetNeedsAnimate() {
648 if (!host_) 647 if (!host_)
649 return; 648 return;
650 649
651 host_->SetNeedsAnimate(); 650 host_->SetNeedsAnimate();
652 } 651 }
653 652
654 } // namespace content 653 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698