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

Unified Diff: cc/output/gl_renderer.cc

Issue 2573603005: Compute damage rect for Cast video compositing (Closed)
Patch Set: Created 4 years 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/output_surface_frame.h » ('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 71861fb361d8b7dac8789e2fa311af09b4f014d7..c32ab20fdbc2267f3af0dd09ba3d6af97ea0f132 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -401,6 +401,7 @@ GLRenderer::GLRenderer(const RendererSettings* settings,
use_blend_equation_advanced_ = context_caps.blend_equation_advanced;
use_blend_equation_advanced_coherent_ =
context_caps.blend_equation_advanced_coherent;
+ use_swap_with_damage_ = context_caps.swap_buffers_with_damage;
InitializeSharedObjects();
}
@@ -2905,6 +2906,7 @@ 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;
+ output_frame.swap_with_damage_rect = gfx::Rect(surface_size);
if (use_partial_swap_) {
// If supported, we can save significant bandwidth by only swapping the
// damaged/scissored region (clamped to the viewport).
@@ -2926,6 +2928,13 @@ void GLRenderer::SwapBuffers(std::vector<ui::LatencyInfo> latency_info) {
output_frame.sub_buffer_rect = swap_buffer_rect_;
}
+ if (use_swap_with_damage_) {
+ gfx::Rect swap_with_damage_rect;
+ if (overlay_processor_->GetSwapWithDamageRect(&swap_with_damage_rect)) {
+ output_frame.swap_with_damage_rect = swap_with_damage_rect;
+ }
+ }
+
swapping_overlay_resources_.push_back(std::move(pending_overlay_resources_));
pending_overlay_resources_.clear();
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/output_surface_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698