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

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

Issue 2213273002: ozone: Consolidate primary plane format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment on a single line. Created 4 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
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/display_compositor/compositor_overlay_candidate_validator.h " 8 #include "components/display_compositor/compositor_overlay_candidate_validator.h "
9 #include "content/browser/gpu/gpu_surface_tracker.h" 9 #include "content/browser/gpu/gpu_surface_tracker.h"
10 #include "content/common/gpu/client/context_provider_command_buffer.h" 10 #include "content/common/gpu/client/context_provider_command_buffer.h"
11 #include "gpu/GLES2/gl2extchromium.h" 11 #include "gpu/GLES2/gl2extchromium.h"
12 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" 12 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h"
13 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" 13 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
14 #include "ui/base/cocoa/remote_layer_api.h" 14 #include "ui/base/cocoa/remote_layer_api.h"
15 #include "ui/display/types/display_snapshot.h"
15 #include "ui/gfx/mac/io_surface.h" 16 #include "ui/gfx/mac/io_surface.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 struct GpuOutputSurfaceMac::RemoteLayers { 20 struct GpuOutputSurfaceMac::RemoteLayers {
20 void UpdateLayers(CAContextID content_ca_context_id, 21 void UpdateLayers(CAContextID content_ca_context_id,
21 CAContextID fullscreen_low_power_ca_context_id) { 22 CAContextID fullscreen_low_power_ca_context_id) {
22 if (content_ca_context_id) { 23 if (content_ca_context_id) {
23 if ([content_layer contextId] != content_ca_context_id) { 24 if ([content_layer contextId] != content_ca_context_id) {
24 content_layer.reset([[CALayerHost alloc] init]); 25 content_layer.reset([[CALayerHost alloc] init]);
(...skipping 30 matching lines...) Expand all
55 overlay_candidate_validator, 56 overlay_candidate_validator,
56 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) 57 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager)
57 : GpuSurfacelessBrowserCompositorOutputSurface( 58 : GpuSurfacelessBrowserCompositorOutputSurface(
58 std::move(context), 59 std::move(context),
59 surface_handle, 60 surface_handle,
60 std::move(vsync_manager), 61 std::move(vsync_manager),
61 begin_frame_source, 62 begin_frame_source,
62 std::move(overlay_candidate_validator), 63 std::move(overlay_candidate_validator),
63 GL_TEXTURE_RECTANGLE_ARB, 64 GL_TEXTURE_RECTANGLE_ARB,
64 GL_RGBA, 65 GL_RGBA,
66 gfx::BufferFormat::RGBA_8888,
65 gpu_memory_buffer_manager), 67 gpu_memory_buffer_manager),
66 remote_layers_(new RemoteLayers) {} 68 remote_layers_(new RemoteLayers) {}
67 69
68 GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {} 70 GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {}
69 71
70 void GpuOutputSurfaceMac::SwapBuffers(cc::CompositorFrame frame) { 72 void GpuOutputSurfaceMac::SwapBuffers(cc::CompositorFrame frame) {
71 GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); 73 GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(std::move(frame));
72 74
73 if (should_show_frames_state_ == 75 if (should_show_frames_state_ ==
74 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { 76 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; 132 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED;
131 } 133 }
132 } 134 }
133 } 135 }
134 136
135 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { 137 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const {
136 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; 138 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED;
137 } 139 }
138 140
139 } // namespace content 141 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698