| OLD | NEW |
| 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 "ui/accelerated_widget_mac/ca_renderer_layer_tree.h" | 5 #include "ui/accelerated_widget_mac/ca_renderer_layer_tree.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 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 ca_edge_aa_mask |= kCALayerTopEdge; | 320 ca_edge_aa_mask |= kCALayerTopEdge; |
| 321 if (edge_aa_mask & GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM) | 321 if (edge_aa_mask & GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM) |
| 322 ca_edge_aa_mask |= kCALayerBottomEdge; | 322 ca_edge_aa_mask |= kCALayerBottomEdge; |
| 323 } | 323 } |
| 324 | 324 |
| 325 // Only allow 4:2:0 frames which fill the layer's contents to be promoted to | 325 // Only allow 4:2:0 frames which fill the layer's contents to be promoted to |
| 326 // AV layers. | 326 // AV layers. |
| 327 if (IOSurfaceGetPixelFormat(io_surface) == | 327 if (IOSurfaceGetPixelFormat(io_surface) == |
| 328 kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange && | 328 kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange && |
| 329 contents_rect == gfx::RectF(0, 0, 1, 1)) { | 329 contents_rect == gfx::RectF(0, 0, 1, 1)) { |
| 330 use_av_layer = true; | 330 // Disable AVSampleBufferDisplayLayer due to reports of memory leaks. |
| 331 // https://crbug.com/631485 |
| 332 use_av_layer = false; |
| 331 } | 333 } |
| 332 } | 334 } |
| 333 | 335 |
| 334 CARendererLayerTree::ContentLayer::ContentLayer(ContentLayer&& layer) | 336 CARendererLayerTree::ContentLayer::ContentLayer(ContentLayer&& layer) |
| 335 : io_surface(layer.io_surface), | 337 : io_surface(layer.io_surface), |
| 336 cv_pixel_buffer(layer.cv_pixel_buffer), | 338 cv_pixel_buffer(layer.cv_pixel_buffer), |
| 337 contents_rect(layer.contents_rect), | 339 contents_rect(layer.contents_rect), |
| 338 rect(layer.rect), | 340 rect(layer.rect), |
| 339 background_color(layer.background_color), | 341 background_color(layer.background_color), |
| 340 ca_edge_aa_mask(layer.ca_edge_aa_mask), | 342 ca_edge_aa_mask(layer.ca_edge_aa_mask), |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } else { | 659 } else { |
| 658 // Grey represents a CALayer that has not changed. | 660 // Grey represents a CALayer that has not changed. |
| 659 color.reset(CGColorCreateGenericRGB(0.5, 0.5, 0.5, 1)); | 661 color.reset(CGColorCreateGenericRGB(0.5, 0.5, 0.5, 1)); |
| 660 } | 662 } |
| 661 [ca_layer setBorderWidth:1]; | 663 [ca_layer setBorderWidth:1]; |
| 662 [ca_layer setBorderColor:color]; | 664 [ca_layer setBorderColor:color]; |
| 663 } | 665 } |
| 664 } | 666 } |
| 665 | 667 |
| 666 } // namespace ui | 668 } // namespace ui |
| OLD | NEW |