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

Unified Diff: cc/output/gl_renderer.cc

Issue 2776923003: cc: Partial draw without partial swap support. (Closed)
Patch Set: avoid BufferQueue::RecreateBuffer changes Created 3 years, 8 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 612c31564878454e01636cf365f22a615440907e..1340e9a4045d60bc01107014182115ca445939ed 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2447,9 +2447,9 @@ void GLRenderer::FinishDrawingFrame() {
pending_sync_queries_.push_back(std::move(current_sync_query_));
}
- swap_buffer_rect_.Union(current_frame()->root_damage_rect);
+ damage_rect_.Union(current_frame()->root_damage_rect);
if (overdraw_feedback_)
- FlushOverdrawFeedback(swap_buffer_rect_);
+ FlushOverdrawFeedback(damage_rect_);
if (use_swap_with_bounds_)
swap_content_bounds_ = current_frame()->root_content_bounds;
@@ -2617,22 +2617,24 @@ 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.damage_rect = damage_rect_;
if (use_swap_with_bounds_) {
output_frame.content_bounds = std::move(swap_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));
+ gfx::Rect swap_buffer_rect = damage_rect_;
+ swap_buffer_rect.Intersect(gfx::Rect(surface_size));
int flipped_y_pos_of_rect_bottom = surface_size.height() -
- swap_buffer_rect_.y() -
- swap_buffer_rect_.height();
+ swap_buffer_rect.y() -
+ swap_buffer_rect.height();
output_frame.sub_buffer_rect =
- gfx::Rect(swap_buffer_rect_.x(),
+ gfx::Rect(swap_buffer_rect.x(),
FlippedRootFramebuffer() ? flipped_y_pos_of_rect_bottom
- : swap_buffer_rect_.y(),
- swap_buffer_rect_.width(), swap_buffer_rect_.height());
- } else if (swap_buffer_rect_.IsEmpty() && allow_empty_swap_) {
- output_frame.sub_buffer_rect = swap_buffer_rect_;
+ : swap_buffer_rect.y(),
+ swap_buffer_rect.width(), swap_buffer_rect.height());
+ } else if (damage_rect_.IsEmpty() && allow_empty_swap_) {
+ output_frame.sub_buffer_rect = gfx::Rect();
}
swapping_overlay_resources_.push_back(std::move(pending_overlay_resources_));
@@ -2640,7 +2642,7 @@ void GLRenderer::SwapBuffers(std::vector<ui::LatencyInfo> latency_info) {
output_surface_->SwapBuffers(std::move(output_frame));
- swap_buffer_rect_ = gfx::Rect();
+ damage_rect_ = gfx::Rect();
}
void GLRenderer::SwapBuffersComplete() {
« 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