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

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

Issue 1273563002: Mac Overlays: Add GPU back-pressure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use default fences Created 5 years, 4 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 "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h" 8 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h"
9 #include "content/browser/compositor/buffer_queue.h" 9 #include "content/browser/compositor/buffer_queue.h"
10 #include "content/browser/compositor/reflector_impl.h" 10 #include "content/browser/compositor/reflector_impl.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const gfx::Size& size, 91 const gfx::Size& size,
92 float scale_factor) { 92 float scale_factor) {
93 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor); 93 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor);
94 DCHECK(output_surface_); 94 DCHECK(output_surface_);
95 output_surface_->Reshape(SurfaceSize(), scale_factor); 95 output_surface_->Reshape(SurfaceSize(), scale_factor);
96 } 96 }
97 97
98 void GpuSurfacelessBrowserCompositorOutputSurface::OnSwapBuffersCompleted( 98 void GpuSurfacelessBrowserCompositorOutputSurface::OnSwapBuffersCompleted(
99 const std::vector<ui::LatencyInfo>& latency_info, 99 const std::vector<ui::LatencyInfo>& latency_info,
100 gfx::SwapResult result) { 100 gfx::SwapResult result) {
101 #if defined(OS_MACOSX)
102 NOTREACHED();
103 #else
101 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { 104 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) {
102 // Even through the swap failed, this is a fixable error so we can pretend 105 // Even through the swap failed, this is a fixable error so we can pretend
103 // it succeeded to the rest of the system. 106 // it succeeded to the rest of the system.
104 result = gfx::SwapResult::SWAP_ACK; 107 result = gfx::SwapResult::SWAP_ACK;
105 output_surface_->RecreateBuffers(); 108 output_surface_->RecreateBuffers();
106 } 109 }
107 GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted(latency_info, 110 GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted(latency_info,
108 result); 111 result);
112 #endif
109 } 113 }
110 114
111 #if defined(OS_MACOSX) 115 #if defined(OS_MACOSX)
112 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() { 116 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() {
113 OnSwapBuffersComplete(); 117 OnSwapBuffersComplete();
114 } 118 }
115 #endif 119 #endif
116 120
117 } // namespace content 121 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698