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

Unified Diff: cc/output/gl_renderer.cc

Issue 2693023002: Use SwapBuffersWithBounds on Chromecast (Closed)
Patch Set: danakj nits Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 60c09db528d65ab2cc7292d06c37d04463f4af72..1b25a88dbae74901cc5f258c76f614b435ff4039 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -402,6 +402,7 @@ GLRenderer::GLRenderer(const RendererSettings* settings,
use_blend_equation_advanced_coherent_ =
context_caps.blend_equation_advanced_coherent;
use_occlusion_query_ = context_caps.occlusion_query;
+ use_swap_with_bounds_ = context_caps.swap_buffers_with_bounds;
InitializeSharedObjects();
}
@@ -417,6 +418,8 @@ GLRenderer::~GLRenderer() {
}
bool GLRenderer::CanPartialSwap() {
+ if (use_swap_with_bounds_)
+ return false;
auto* context_provider = output_surface_->context_provider();
return context_provider->ContextCapabilities().post_sub_buffer;
}
@@ -2591,7 +2594,9 @@ void GLRenderer::SwapBuffers(std::vector<ui::LatencyInfo> latency_info) {
OutputSurfaceFrame output_frame;
output_frame.latency_info = std::move(latency_info);
output_frame.size = surface_size;
- if (use_partial_swap_) {
+ if (use_swap_with_bounds_) {
+ output_frame.content_bounds = current_frame()->root_content_bounds;
+ } else if (use_partial_swap_) {
// If supported, we can save significant bandwidth by only swapping the
// damaged/scissored region (clamped to the viewport).
swap_buffer_rect_.Intersect(gfx::Rect(surface_size));
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698