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

Unified Diff: services/ui/surfaces/display_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
« no previous file with comments | « services/ui/surfaces/display_output_surface.h ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_output_surface.cc
diff --git a/services/ui/surfaces/display_output_surface.cc b/services/ui/surfaces/display_output_surface.cc
index 37604e770553fb265c01fceb7bd7149b56a51500..85ece68dd7dfaa9e5d9c8c295e188d26eab6ab94 100644
--- a/services/ui/surfaces/display_output_surface.cc
+++ b/services/ui/surfaces/display_output_surface.cc
@@ -54,17 +54,32 @@ void DisplayOutputSurface::BindFramebuffer() {
context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0);
}
+void DisplayOutputSurface::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());
+}
+
void DisplayOutputSurface::Reshape(const gfx::Size& size,
float device_scale_factor,
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);
}
void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) {
DCHECK(context_provider_);
+ set_draw_rectangle_for_frame_ = false;
if (frame.sub_buffer_rect) {
context_provider_->ContextSupport()->PartialSwapBuffers(
*frame.sub_buffer_rect);
« no previous file with comments | « services/ui/surfaces/display_output_surface.h ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698