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

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: rebase 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/compositor/compositor.h" 16 #include "ui/compositor/compositor.h"
16 #include "ui/display/types/display_snapshot.h" 17 #include "ui/display/types/display_snapshot.h"
17 #include "ui/gfx/mac/io_surface.h" 18 #include "ui/gfx/mac/io_surface.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 remote_layers_->fullscreen_low_power_layer.get(), 100 remote_layers_->fullscreen_low_power_layer.get(),
100 base::scoped_policy::RETAIN), 101 base::scoped_policy::RETAIN),
101 params_mac->pixel_size, params_mac->scale_factor); 102 params_mac->pixel_size, params_mac->scale_factor);
102 } else { 103 } else {
103 widget->GotIOSurfaceFrame(params_mac->io_surface, 104 widget->GotIOSurfaceFrame(params_mac->io_surface,
104 params_mac->pixel_size, 105 params_mac->pixel_size,
105 params_mac->scale_factor); 106 params_mac->scale_factor);
106 } 107 }
107 } 108 }
108 } 109 }
109 DidReceiveTextureInUseResponses(params_mac->responses); 110 client_->DidReceiveTextureInUseResponses(params_mac->responses);
110 GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 111 GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
111 latency_info, result, params_mac); 112 latency_info, result, params_mac);
112 } 113 }
113 114
114 void GpuOutputSurfaceMac::SetSurfaceSuspendedForRecycle(bool suspended) { 115 void GpuOutputSurfaceMac::SetSurfaceSuspendedForRecycle(bool suspended) {
115 if (suspended) { 116 if (suspended) {
116 // It may be that there are frames in-flight from the GPU process back to 117 // It may be that there are frames in-flight from the GPU process back to
117 // the browser. Make sure that these frames are not displayed by ignoring 118 // the browser. Make sure that these frames are not displayed by ignoring
118 // them in GpuProcessHostUIShim, until the browser issues a SwapBuffers for 119 // them in GpuProcessHostUIShim, until the browser issues a SwapBuffers for
119 // the new content. 120 // the new content.
(...skipping 13 matching lines...) Expand all
133 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; 134 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED;
134 } 135 }
135 } 136 }
136 } 137 }
137 138
138 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { 139 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const {
139 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; 140 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED;
140 } 141 }
141 142
142 } // namespace content 143 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698