| 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);
|
| } 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
|
|
|