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

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

Issue 2392183003: cc: Remove SurfaceSize from OutputSurface. (Closed)
Patch Set: nosurfacesize: ozonethinger Created 4 years, 2 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 fec90677d6ebd49da7c18f60bcbae4f70c66deb9..ff3b2e3ce813c8bf84fa49155274c9a883ec4881 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -90,25 +90,22 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers(cc::CompositorFrame frame) {
GetCommandBufferProxy()->SetLatencyInfo(frame.metadata.latency_info);
+ gfx::Rect swap_rect = frame.gl_frame_data->sub_buffer_rect;
+ gfx::Size surface_size = frame.gl_frame_data->size;
if (reflector_) {
- if (frame.gl_frame_data->sub_buffer_rect ==
- gfx::Rect(frame.gl_frame_data->size)) {
- reflector_texture_->CopyTextureFullImage(SurfaceSize());
- reflector_->OnSourceSwapBuffers();
+ if (swap_rect == gfx::Rect(surface_size)) {
+ reflector_texture_->CopyTextureFullImage(surface_size);
+ reflector_->OnSourceSwapBuffers(surface_size);
} else {
- const gfx::Rect& rect = frame.gl_frame_data->sub_buffer_rect;
- reflector_texture_->CopyTextureSubImage(rect);
- reflector_->OnSourcePostSubBuffer(rect);
+ reflector_texture_->CopyTextureSubImage(swap_rect);
+ reflector_->OnSourcePostSubBuffer(swap_rect, surface_size);
}
}
- if (frame.gl_frame_data->sub_buffer_rect ==
- gfx::Rect(frame.gl_frame_data->size)) {
+ if (swap_rect == gfx::Rect(frame.gl_frame_data->size))
context_provider_->ContextSupport()->Swap();
- } else {
- context_provider_->ContextSupport()->PartialSwapBuffers(
- frame.gl_frame_data->sub_buffer_rect);
- }
+ else
+ context_provider_->ContextSupport()->PartialSwapBuffers(swap_rect);
}
uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {

Powered by Google App Engine
This is Rietveld 408576698