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

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

Issue 1454323002: Display skips swapping if overlays draw the damage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try skipping the swap at the cc::Display level Created 5 years, 1 month 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 | « cc/surfaces/display.cc ('k') | 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const base::Callback<void(gpu::Capabilities)>& 81 const base::Callback<void(gpu::Capabilities)>&
82 populate_gpu_capabilities_callback) 82 populate_gpu_capabilities_callback)
83 : cc::OutputSurface(context_provider), 83 : cc::OutputSurface(context_provider),
84 compositor_(compositor), 84 compositor_(compositor),
85 populate_gpu_capabilities_callback_(populate_gpu_capabilities_callback), 85 populate_gpu_capabilities_callback_(populate_gpu_capabilities_callback),
86 swap_buffers_completion_callback_( 86 swap_buffers_completion_callback_(
87 base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted, 87 base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted,
88 base::Unretained(this))) { 88 base::Unretained(this))) {
89 capabilities_.adjust_deadline_for_parent = false; 89 capabilities_.adjust_deadline_for_parent = false;
90 capabilities_.max_frames_pending = kMaxDisplaySwapBuffers; 90 capabilities_.max_frames_pending = kMaxDisplaySwapBuffers;
91 capabilities_.schedules_overlays_without_swap = true;
91 } 92 }
92 93
93 ~OutputSurfaceWithoutParent() override { compositor_->RemoveObserver(this); } 94 ~OutputSurfaceWithoutParent() override { compositor_->RemoveObserver(this); }
94 95
95 void SwapBuffers(cc::CompositorFrame* frame) override { 96 void SwapBuffers(cc::CompositorFrame* frame) override {
96 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info); 97 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info);
97 DCHECK(frame->gl_frame_data->sub_buffer_rect == 98 DCHECK(frame->gl_frame_data->sub_buffer_rect ==
98 gfx::Rect(frame->gl_frame_data->size)); 99 gfx::Rect(frame->gl_frame_data->size));
99 context_provider_->ContextSupport()->Swap(); 100 context_provider_->ContextSupport()->Swap();
100 client_->DidSwapBuffers(); 101 client_->DidSwapBuffers();
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 800
800 void CompositorImpl::SetNeedsAnimate() { 801 void CompositorImpl::SetNeedsAnimate() {
801 needs_animate_ = true; 802 needs_animate_ = true;
802 if (!host_->visible()) 803 if (!host_->visible())
803 return; 804 return;
804 805
805 host_->SetNeedsAnimate(); 806 host_->SetNeedsAnimate();
806 } 807 }
807 808
808 } // namespace content 809 } // namespace content
OLDNEW
« no previous file with comments | « cc/surfaces/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698