 Chromium Code Reviews
 Chromium Code Reviews Issue 2699173002:
  cc: Make OutputSurfaceFrame::sub_buffer_rect optional  (Closed)
    
  
    Issue 2699173002:
  cc: Make OutputSurfaceFrame::sub_buffer_rect optional  (Closed) 
  | 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() { |