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

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

Issue 543543002: android: Don't invalidate UI resources if context is lost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clankium
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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 577 }
578 578
579 void CompositorImpl::PopulateGpuCapabilities( 579 void CompositorImpl::PopulateGpuCapabilities(
580 gpu::Capabilities gpu_capabilities) { 580 gpu::Capabilities gpu_capabilities) {
581 ui_resource_provider_.SetSupportsETC1NonPowerOfTwo( 581 ui_resource_provider_.SetSupportsETC1NonPowerOfTwo(
582 gpu_capabilities.texture_format_etc1_npot); 582 gpu_capabilities.texture_format_etc1_npot);
583 } 583 }
584 584
585 void CompositorImpl::OnLostResources() { 585 void CompositorImpl::OnLostResources() {
586 client_->DidLoseResources(); 586 client_->DidLoseResources();
587 ui_resource_provider_.UIResourcesAreInvalid();
588 } 587 }
589 588
590 void CompositorImpl::ScheduleComposite() { 589 void CompositorImpl::ScheduleComposite() {
591 DCHECK(!needs_composite_ || WillComposite()); 590 DCHECK(!needs_composite_ || WillComposite());
592 if (ignore_schedule_composite_) 591 if (ignore_schedule_composite_)
593 return; 592 return;
594 593
595 needs_composite_ = true; 594 needs_composite_ = true;
596 // We currently expect layer tree invalidations at most once per frame 595 // We currently expect layer tree invalidations at most once per frame
597 // during normal operation and therefore try to composite immediately 596 // during normal operation and therefore try to composite immediately
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 } 669 }
671 670
672 void CompositorImpl::SetNeedsAnimate() { 671 void CompositorImpl::SetNeedsAnimate() {
673 if (!host_) 672 if (!host_)
674 return; 673 return;
675 674
676 host_->SetNeedsAnimate(); 675 host_->SetNeedsAnimate();
677 } 676 }
678 677
679 } // namespace content 678 } // 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