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

Side by Side Diff: content/common/gpu/ca_layer_tree_mac.mm

Issue 1846913007: Mac: Disable use of AVSampleBufferDisplayLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: https Created 4 years, 8 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 | « no previous file | content/common/gpu/ca_layer_tree_unittest_mac.mm » ('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/common/gpu/ca_layer_tree_mac.h" 5 #include "content/common/gpu/ca_layer_tree_mac.h"
6 6
7 #include <AVFoundation/AVFoundation.h> 7 #include <AVFoundation/AVFoundation.h>
8 #include <CoreMedia/CoreMedia.h> 8 #include <CoreMedia/CoreMedia.h>
9 #include <CoreVideo/CoreVideo.h> 9 #include <CoreVideo/CoreVideo.h>
10 10
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 background_color(background_color), 226 background_color(background_color),
227 ca_edge_aa_mask(0), 227 ca_edge_aa_mask(0),
228 opacity(opacity) { 228 opacity(opacity) {
229 // Because the root layer has setGeometryFlipped:YES, there is some ambiguity 229 // Because the root layer has setGeometryFlipped:YES, there is some ambiguity
230 // about what exactly top and bottom mean. This ambiguity is resolved in 230 // about what exactly top and bottom mean. This ambiguity is resolved in
231 // different ways for solid color CALayers and for CALayers that have content 231 // different ways for solid color CALayers and for CALayers that have content
232 // (surprise!). For CALayers with IOSurface content, the top edge in the AA 232 // (surprise!). For CALayers with IOSurface content, the top edge in the AA
233 // mask refers to what appears as the bottom edge on-screen. For CALayers 233 // mask refers to what appears as the bottom edge on-screen. For CALayers
234 // without content (solid color layers), the top edge in the AA mask is the 234 // without content (solid color layers), the top edge in the AA mask is the
235 // top edge on-screen. 235 // top edge on-screen.
236 // http://crbug.com/567946 236 // https://crbug.com/567946
237 if (edge_aa_mask & GL_CA_LAYER_EDGE_LEFT_CHROMIUM) 237 if (edge_aa_mask & GL_CA_LAYER_EDGE_LEFT_CHROMIUM)
238 ca_edge_aa_mask |= kCALayerLeftEdge; 238 ca_edge_aa_mask |= kCALayerLeftEdge;
239 if (edge_aa_mask & GL_CA_LAYER_EDGE_RIGHT_CHROMIUM) 239 if (edge_aa_mask & GL_CA_LAYER_EDGE_RIGHT_CHROMIUM)
240 ca_edge_aa_mask |= kCALayerRightEdge; 240 ca_edge_aa_mask |= kCALayerRightEdge;
241 if (io_surface) { 241 if (io_surface) {
242 if (edge_aa_mask & GL_CA_LAYER_EDGE_TOP_CHROMIUM) 242 if (edge_aa_mask & GL_CA_LAYER_EDGE_TOP_CHROMIUM)
243 ca_edge_aa_mask |= kCALayerBottomEdge; 243 ca_edge_aa_mask |= kCALayerBottomEdge;
244 if (edge_aa_mask & GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM) 244 if (edge_aa_mask & GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM)
245 ca_edge_aa_mask |= kCALayerTopEdge; 245 ca_edge_aa_mask |= kCALayerTopEdge;
246 } else { 246 } else {
247 if (edge_aa_mask & GL_CA_LAYER_EDGE_TOP_CHROMIUM) 247 if (edge_aa_mask & GL_CA_LAYER_EDGE_TOP_CHROMIUM)
248 ca_edge_aa_mask |= kCALayerTopEdge; 248 ca_edge_aa_mask |= kCALayerTopEdge;
249 if (edge_aa_mask & GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM) 249 if (edge_aa_mask & GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM)
250 ca_edge_aa_mask |= kCALayerBottomEdge; 250 ca_edge_aa_mask |= kCALayerBottomEdge;
251 } 251 }
252 252
253 // Only allow 4:2:0 frames which fill the layer's contents to be promoted to 253 // Only allow 4:2:0 frames which fill the layer's contents to be promoted to
254 // AV layers. 254 // AV layers.
255 if (IOSurfaceGetPixelFormat(io_surface) == 255 if (IOSurfaceGetPixelFormat(io_surface) ==
256 kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange && 256 kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange &&
257 contents_rect == gfx::RectF(0, 0, 1, 1)) { 257 contents_rect == gfx::RectF(0, 0, 1, 1)) {
258 use_av_layer = true; 258 // Leave AVFoundation disabled for now while crashing and flashing bugs are
259 // being investigated.
260 // https://crbug.com/598243, https://crbug.com/598388
261 use_av_layer = false;
259 } 262 }
260 } 263 }
261 264
262 CALayerTree::ContentLayer::ContentLayer(ContentLayer&& layer) 265 CALayerTree::ContentLayer::ContentLayer(ContentLayer&& layer)
263 : io_surface(layer.io_surface), 266 : io_surface(layer.io_surface),
264 contents_rect(layer.contents_rect), 267 contents_rect(layer.contents_rect),
265 rect(layer.rect), 268 rect(layer.rect),
266 background_color(layer.background_color), 269 background_color(layer.background_color),
267 ca_edge_aa_mask(layer.ca_edge_aa_mask), 270 ca_edge_aa_mask(layer.ca_edge_aa_mask),
268 opacity(layer.opacity), 271 opacity(layer.opacity),
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 } else { 562 } else {
560 // Grey represents a CALayer that has not changed. 563 // Grey represents a CALayer that has not changed.
561 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); 564 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1));
562 } 565 }
563 [ca_layer setBorderWidth:1]; 566 [ca_layer setBorderWidth:1];
564 [ca_layer setBorderColor:color]; 567 [ca_layer setBorderColor:color];
565 } 568 }
566 } 569 }
567 570
568 } // namespace content 571 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/ca_layer_tree_unittest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698