Index: content/browser/compositor/gpu_browser_compositor_output_surface.cc |
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_browser_compositor_output_surface.cc |
index 8ad8384dbaf8e62208841f95deb10c877d651ceb..898aafa7b1b4c222a687b0b396b9c2b604a41388 100644 |
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc |
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc |
@@ -88,6 +88,8 @@ void GpuBrowserCompositorOutputSurface::Reshape( |
const gfx::ColorSpace& color_space, |
bool has_alpha, |
bool use_stencil) { |
+ size_ = size; |
+ has_set_draw_rectangle_ = false; |
context_provider()->ContextGL()->ResizeCHROMIUM( |
size.width(), size.height(), device_scale_factor, has_alpha); |
} |
@@ -108,6 +110,8 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers( |
} |
} |
+ set_draw_rectangle_for_frame_ = false; |
+ |
if (swap_rect == gfx::Rect(frame.size)) |
context_provider_->ContextSupport()->Swap(); |
else |
@@ -136,6 +140,18 @@ void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
bool suspended) {} |
#endif |
+void GpuBrowserCompositorOutputSurface::SetDrawRectangle( |
+ const gfx::Rect& rect) { |
+ if (set_draw_rectangle_for_frame_) |
+ return; |
+ DCHECK(gfx::Rect(size_).Contains(rect)); |
+ DCHECK(has_set_draw_rectangle_ || (gfx::Rect(size_) == rect)); |
+ set_draw_rectangle_for_frame_ = true; |
+ has_set_draw_rectangle_ = true; |
+ context_provider()->ContextGL()->SetDrawRectangleCHROMIUM( |
+ rect.x(), rect.y(), rect.width(), rect.height()); |
+} |
+ |
gpu::CommandBufferProxyImpl* |
GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { |
ui::ContextProviderCommandBuffer* provider_command_buffer = |