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

Side by Side Diff: content/browser/compositor/gpu_output_surface_mac.mm

Issue 2352963002: cc: Make most of cc::OutputSurface abstract. (Closed)
Patch Set: outputsurface-cleanup: . 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_output_surface_mac.h" 5 #include "content/browser/compositor/gpu_output_surface_mac.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/output/output_surface_client.h"
8 #include "components/display_compositor/compositor_overlay_candidate_validator.h " 9 #include "components/display_compositor/compositor_overlay_candidate_validator.h "
9 #include "content/browser/gpu/gpu_surface_tracker.h" 10 #include "content/browser/gpu/gpu_surface_tracker.h"
10 #include "content/common/gpu/client/context_provider_command_buffer.h" 11 #include "content/common/gpu/client/context_provider_command_buffer.h"
11 #include "gpu/GLES2/gl2extchromium.h" 12 #include "gpu/GLES2/gl2extchromium.h"
12 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" 13 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h"
13 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" 14 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
14 #include "ui/base/cocoa/remote_layer_api.h" 15 #include "ui/base/cocoa/remote_layer_api.h"
15 #include "ui/display/types/display_snapshot.h" 16 #include "ui/display/types/display_snapshot.h"
16 #include "ui/gfx/mac/io_surface.h" 17 #include "ui/gfx/mac/io_surface.h"
17 18
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 remote_layers_->fullscreen_low_power_layer.get(), 99 remote_layers_->fullscreen_low_power_layer.get(),
99 base::scoped_policy::RETAIN), 100 base::scoped_policy::RETAIN),
100 params_mac->pixel_size, params_mac->scale_factor); 101 params_mac->pixel_size, params_mac->scale_factor);
101 } else { 102 } else {
102 widget->GotIOSurfaceFrame(params_mac->io_surface, 103 widget->GotIOSurfaceFrame(params_mac->io_surface,
103 params_mac->pixel_size, 104 params_mac->pixel_size,
104 params_mac->scale_factor); 105 params_mac->scale_factor);
105 } 106 }
106 } 107 }
107 } 108 }
108 DidReceiveTextureInUseResponses(params_mac->responses); 109 client_->DidReceiveTextureInUseResponses(params_mac->responses);
109 GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 110 GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
110 latency_info, result, params_mac); 111 latency_info, result, params_mac);
111 } 112 }
112 113
113 void GpuOutputSurfaceMac::SetSurfaceSuspendedForRecycle(bool suspended) { 114 void GpuOutputSurfaceMac::SetSurfaceSuspendedForRecycle(bool suspended) {
114 if (suspended) { 115 if (suspended) {
115 // It may be that there are frames in-flight from the GPU process back to 116 // It may be that there are frames in-flight from the GPU process back to
116 // the browser. Make sure that these frames are not displayed by ignoring 117 // the browser. Make sure that these frames are not displayed by ignoring
117 // them in GpuProcessHostUIShim, until the browser issues a SwapBuffers for 118 // them in GpuProcessHostUIShim, until the browser issues a SwapBuffers for
118 // the new content. 119 // the new content.
(...skipping 13 matching lines...) Expand all
132 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; 133 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED;
133 } 134 }
134 } 135 }
135 } 136 }
136 137
137 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { 138 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const {
138 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; 139 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED;
139 } 140 }
140 141
141 } // namespace content 142 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698