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

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

Issue 2699173002: cc: Make OutputSurfaceFrame::sub_buffer_rect optional (Closed)
Patch Set: 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 8ad8384dbaf8e62208841f95deb10c877d651ceb..f7c046cf332dc1e06696d0f94ed59fae66aace11 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -96,22 +96,22 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers(
cc::OutputSurfaceFrame frame) {
GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info);
- gfx::Rect swap_rect = frame.sub_buffer_rect;
gfx::Size surface_size = frame.size;
if (reflector_) {
- if (swap_rect == gfx::Rect(surface_size)) {
+ if (frame.sub_buffer_rect) {
+ reflector_texture_->CopyTextureSubImage(*frame.sub_buffer_rect);
+ reflector_->OnSourcePostSubBuffer(*frame.sub_buffer_rect, surface_size);
+ } else {
reflector_texture_->CopyTextureFullImage(surface_size);
reflector_->OnSourceSwapBuffers(surface_size);
- } else {
- reflector_texture_->CopyTextureSubImage(swap_rect);
- reflector_->OnSourcePostSubBuffer(swap_rect, surface_size);
}
}
- if (swap_rect == gfx::Rect(frame.size))
- context_provider_->ContextSupport()->Swap();
+ if (frame.sub_buffer_rect)
danakj 2017/02/22 00:36:57 {}
halliwell 2017/02/22 14:19:28 Done.
+ context_provider_->ContextSupport()->PartialSwapBuffers(
+ *frame.sub_buffer_rect);
else
danakj 2017/02/22 00:36:57 {}
halliwell 2017/02/22 14:19:27 Done.
- context_provider_->ContextSupport()->PartialSwapBuffers(swap_rect);
+ context_provider_->ContextSupport()->Swap();
}
uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {

Powered by Google App Engine
This is Rietveld 408576698