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

Side by Side Diff: content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc

Issue 2699173002: cc: Make OutputSurfaceFrame::sub_buffer_rect optional (Closed)
Patch Set: Removed obsolete comment 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h" 5 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/output/output_surface_client.h" 9 #include "cc/output/output_surface_client.h"
10 #include "cc/output/output_surface_frame.h" 10 #include "cc/output/output_surface_frame.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return buffer_queue_->current_texture_id(); 66 return buffer_queue_->current_texture_id();
67 } 67 }
68 68
69 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( 69 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(
70 cc::OutputSurfaceFrame frame) { 70 cc::OutputSurfaceFrame frame) {
71 DCHECK(buffer_queue_); 71 DCHECK(buffer_queue_);
72 DCHECK(reshape_size_ == frame.size); 72 DCHECK(reshape_size_ == frame.size);
73 // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted 73 // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted
74 // happens, we'd see the wrong swap size there? 74 // happens, we'd see the wrong swap size there?
75 swap_size_ = reshape_size_; 75 swap_size_ = reshape_size_;
76 buffer_queue_->SwapBuffers(frame.sub_buffer_rect); 76 buffer_queue_->SwapBuffers(frame.sub_buffer_rect ? *frame.sub_buffer_rect
77 : gfx::Rect(swap_size_));
77 GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); 78 GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame));
78 } 79 }
79 80
80 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { 81 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() {
81 DCHECK(buffer_queue_); 82 DCHECK(buffer_queue_);
82 buffer_queue_->BindFramebuffer(); 83 buffer_queue_->BindFramebuffer();
83 } 84 }
84 85
85 GLenum GpuSurfacelessBrowserCompositorOutputSurface:: 86 GLenum GpuSurfacelessBrowserCompositorOutputSurface::
86 GetFramebufferCopyTextureFormat() { 87 GetFramebufferCopyTextureFormat() {
(...skipping 26 matching lines...) Expand all
113 force_swap = true; 114 force_swap = true;
114 } 115 }
115 buffer_queue_->PageFlipComplete(); 116 buffer_queue_->PageFlipComplete();
116 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
117 latency_info, result, params_mac); 118 latency_info, result, params_mac);
118 if (force_swap) 119 if (force_swap)
119 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); 120 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_));
120 } 121 }
121 122
122 } // namespace content 123 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698