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

Unified Diff: cc/output/gl_renderer.cc

Issue 16730003: Aura: Support --enable-partial-swap with --composite-to-mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address sievers@s comments. Created 7 years, 6 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') | content/browser/renderer_host/render_widget_host_view_aura.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 4519af374cf4d784be4a5c63beaa0f81c8746a6a..558b74d7e608e94a50e3f47fa38f18a8fa5cbe26 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1828,6 +1828,8 @@ void GLRenderer::FinishDrawingFrame(DrawingFrame* frame) {
if (Settings().compositor_frame_message) {
CompositorFrame compositor_frame;
compositor_frame.metadata = client_->MakeCompositorFrameMetadata();
+ compositor_frame.gl_frame_data.reset(new GLFrameData());
+ compositor_frame.gl_frame_data->damage_rect = GetFrameDamage();
output_surface_->SendFrameToParentCompositor(&compositor_frame);
}
}
@@ -1959,15 +1961,7 @@ void GLRenderer::SwapBuffers(const ui::LatencyInfo& latency_info) {
if (capabilities_.using_partial_swap && client_->AllowPartialSwap()) {
// If supported, we can save significant bandwidth by only swapping the
// damaged/scissored region (clamped to the viewport)
- swap_buffer_rect_.Intersect(client_->DeviceViewport());
- int flipped_y_pos_of_rect_bottom =
- client_->DeviceViewport().height() - swap_buffer_rect_.y() -
- swap_buffer_rect_.height();
- output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(),
- flipped_y_pos_of_rect_bottom,
- swap_buffer_rect_.width(),
- swap_buffer_rect_.height()),
- latency_info);
+ output_surface_->PostSubBuffer(GetFrameDamage(), latency_info);
aelias_OOO_until_Jul13 2013/06/10 22:20:12 To be clearer about what I was asking for earlier,
aelias_OOO_until_Jul13 2013/06/10 23:20:20 On second thought, since this doesn't truly need t
} else {
output_surface_->SwapBuffers(latency_info);
}
@@ -2904,4 +2898,13 @@ bool GLRenderer::IsContextLost() {
return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR);
}
+gfx::Rect GLRenderer::GetFrameDamage() {
+ gfx::Rect frame_damage = swap_buffer_rect_;
+ frame_damage.Intersect(client_->DeviceViewport());
+ int flipped_y_pos_of_rect_bottom = client_->DeviceViewport().height() -
+ frame_damage.y() - frame_damage.height();
+ frame_damage.set_y(flipped_y_pos_of_rect_bottom);
+ return frame_damage;
+}
+
} // namespace cc
« no previous file with comments | « cc/output/gl_renderer.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698