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

Unified Diff: content/browser/compositor/gpu_browser_compositor_output_surface.cc

Issue 2646243002: Use IDCompositionSurface to implement DirectCompositionSurfaceWin. (Closed)
Patch Set: rebase Created 3 years, 10 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
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 ffe7868eed676f07b6af225c5df53c664924f8ae..4cdfbb78650dd035d8ff2b8659dc75090cd89159 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -96,6 +96,8 @@ void GpuBrowserCompositorOutputSurface::Reshape(
const gfx::ColorSpace& color_space,
bool has_alpha,
bool use_stencil) {
+ size_ = size;
+ has_set_draw_rectangle_since_last_resize_ = false;
context_provider()->ContextGL()->ResizeCHROMIUM(
size.width(), size.height(), device_scale_factor, has_alpha);
}
@@ -115,6 +117,8 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers(
}
}
+ set_draw_rectangle_for_frame_ = false;
+
if (frame.sub_buffer_rect) {
DCHECK(frame.content_bounds.empty());
context_provider_->ContextSupport()->PartialSwapBuffers(
@@ -148,6 +152,19 @@ 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_since_last_resize_ ||
+ (gfx::Rect(size_) == rect));
+ set_draw_rectangle_for_frame_ = true;
+ has_set_draw_rectangle_since_last_resize_ = true;
+ context_provider()->ContextGL()->SetDrawRectangleCHROMIUM(
+ rect.x(), rect.y(), rect.width(), rect.height());
+}
+
gpu::CommandBufferProxyImpl*
GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
ui::ContextProviderCommandBuffer* provider_command_buffer =

Powered by Google App Engine
This is Rietveld 408576698