| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 if (current_layer.transform == params.transform) | 387 if (current_layer.transform == params.transform) |
| 388 needs_new_transform_layer = false; | 388 needs_new_transform_layer = false; |
| 389 } | 389 } |
| 390 if (needs_new_transform_layer) | 390 if (needs_new_transform_layer) |
| 391 transform_layers.push_back(TransformLayer(params.transform)); | 391 transform_layers.push_back(TransformLayer(params.transform)); |
| 392 transform_layers.back().AddContentLayer(params); | 392 transform_layers.back().AddContentLayer(params); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void CARendererLayerTree::TransformLayer::AddContentLayer( | 395 void CARendererLayerTree::TransformLayer::AddContentLayer( |
| 396 const CARendererLayerParams& params) { | 396 const CARendererLayerParams& params) { |
| 397 gl::GLImageIOSurface* io_surface_image = | 397 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; |
| 398 gl::GLImageIOSurface::FromGLImage(params.image); | 398 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer; |
| 399 DCHECK(io_surface_image); | 399 if (params.image) { |
| 400 base::ScopedCFTypeRef<IOSurfaceRef> io_surface = | 400 gl::GLImageIOSurface* io_surface_image = |
| 401 io_surface_image->io_surface(); | 401 gl::GLImageIOSurface::FromGLImage(params.image); |
| 402 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer = | 402 DCHECK(io_surface_image); |
| 403 io_surface_image->cv_pixel_buffer(); | 403 io_surface = io_surface_image->io_surface(); |
| 404 cv_pixel_buffer = io_surface_image->cv_pixel_buffer(); |
| 405 } |
| 404 | 406 |
| 405 content_layers.push_back( | 407 content_layers.push_back( |
| 406 ContentLayer(io_surface, cv_pixel_buffer, params.contents_rect, | 408 ContentLayer(io_surface, cv_pixel_buffer, params.contents_rect, |
| 407 params.rect, params.background_color, params.edge_aa_mask, | 409 params.rect, params.background_color, params.edge_aa_mask, |
| 408 params.opacity, params.filter)); | 410 params.opacity, params.filter)); |
| 409 } | 411 } |
| 410 | 412 |
| 411 void CARendererLayerTree::RootLayer::CommitToCA(CALayer* superlayer, | 413 void CARendererLayerTree::RootLayer::CommitToCA(CALayer* superlayer, |
| 412 RootLayer* old_layer, | 414 RootLayer* old_layer, |
| 413 float scale_factor) { | 415 float scale_factor) { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 } else { | 622 } else { |
| 621 // Grey represents a CALayer that has not changed. | 623 // Grey represents a CALayer that has not changed. |
| 622 color.reset(CGColorCreateGenericRGB(0.5, 0.5, 0.5, 1)); | 624 color.reset(CGColorCreateGenericRGB(0.5, 0.5, 0.5, 1)); |
| 623 } | 625 } |
| 624 [ca_layer setBorderWidth:1]; | 626 [ca_layer setBorderWidth:1]; |
| 625 [ca_layer setBorderColor:color]; | 627 [ca_layer setBorderColor:color]; |
| 626 } | 628 } |
| 627 } | 629 } |
| 628 | 630 |
| 629 } // namespace ui | 631 } // namespace ui |
| OLD | NEW |