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

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

Issue 2399983003: cc: Make OutputSurface::Reshape abstract (Closed)
Patch Set: reshapeabstract: . 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 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 buffer_queue_->BindFramebuffer(); 84 buffer_queue_->BindFramebuffer();
85 } 85 }
86 86
87 GLenum GpuSurfacelessBrowserCompositorOutputSurface:: 87 GLenum GpuSurfacelessBrowserCompositorOutputSurface::
88 GetFramebufferCopyTextureFormat() { 88 GetFramebufferCopyTextureFormat() {
89 return buffer_queue_->internal_format(); 89 return buffer_queue_->internal_format();
90 } 90 }
91 91
92 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( 92 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape(
93 const gfx::Size& size, 93 const gfx::Size& size,
94 float scale_factor, 94 float device_scale_factor,
95 const gfx::ColorSpace& color_space, 95 const gfx::ColorSpace& color_space,
96 bool alpha) { 96 bool has_alpha) {
97 reshape_size_ = size; 97 reshape_size_ = size;
98 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor, color_space, 98 GpuBrowserCompositorOutputSurface::Reshape(size, device_scale_factor,
99 alpha); 99 color_space, has_alpha);
100 DCHECK(buffer_queue_); 100 DCHECK(buffer_queue_);
101 buffer_queue_->Reshape(size, scale_factor, color_space); 101 buffer_queue_->Reshape(size, device_scale_factor, color_space);
102 } 102 }
103 103
104 void GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 104 void GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
105 const std::vector<ui::LatencyInfo>& latency_info, 105 const std::vector<ui::LatencyInfo>& latency_info,
106 gfx::SwapResult result, 106 gfx::SwapResult result,
107 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { 107 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
108 bool force_swap = false; 108 bool force_swap = false;
109 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { 109 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) {
110 // Even through the swap failed, this is a fixable error so we can pretend 110 // Even through the swap failed, this is a fixable error so we can pretend
111 // it succeeded to the rest of the system. 111 // it succeeded to the rest of the system.
112 result = gfx::SwapResult::SWAP_ACK; 112 result = gfx::SwapResult::SWAP_ACK;
113 buffer_queue_->RecreateBuffers(); 113 buffer_queue_->RecreateBuffers();
114 force_swap = true; 114 force_swap = true;
115 } 115 }
116 buffer_queue_->PageFlipComplete(); 116 buffer_queue_->PageFlipComplete();
117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
118 latency_info, result, params_mac); 118 latency_info, result, params_mac);
119 if (force_swap) 119 if (force_swap)
120 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); 120 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_));
121 } 121 }
122 122
123 } // namespace content 123 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698