| 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 #ifndef UI_ACCELERATED_WIDGET_MAC_CA_RENDERER_LAYER_TREE_H_ | 5 #ifndef UI_ACCELERATED_WIDGET_MAC_CA_RENDERER_LAYER_TREE_H_ |
| 6 #define UI_ACCELERATED_WIDGET_MAC_CA_RENDERER_LAYER_TREE_H_ | 6 #define UI_ACCELERATED_WIDGET_MAC_CA_RENDERER_LAYER_TREE_H_ |
| 7 | 7 |
| 8 #include <IOSurface/IOSurface.h> | 8 #include <IOSurface/IOSurface.h> |
| 9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
| 10 | 10 |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/mac/scoped_cftyperef.h" | 15 #include "base/mac/scoped_cftyperef.h" |
| 16 #include "base/mac/scoped_nsobject.h" | 16 #include "base/mac/scoped_nsobject.h" |
| 17 #include "base/memory/ref_counted.h" |
| 17 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" | 18 #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" |
| 18 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
| 19 #include "ui/gfx/geometry/rect_f.h" | 20 #include "ui/gfx/geometry/rect_f.h" |
| 20 #include "ui/gfx/mac/io_surface.h" | 21 #include "ui/gfx/mac/io_surface.h" |
| 21 #include "ui/gfx/transform.h" | 22 #include "ui/gfx/transform.h" |
| 22 | 23 |
| 23 @class AVSampleBufferDisplayLayer; | 24 @class AVSampleBufferDisplayLayer; |
| 24 | 25 |
| 25 namespace ui { | 26 namespace ui { |
| 26 | 27 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 float scale_factor); | 53 float scale_factor); |
| 53 | 54 |
| 54 // Check to see if the CALayer tree can be represented entirely by a video | 55 // Check to see if the CALayer tree can be represented entirely by a video |
| 55 // layer on a black background. If so, then set |fullscreen_low_power_layer| | 56 // layer on a black background. If so, then set |fullscreen_low_power_layer| |
| 56 // to draw this content and return true. Otherwise return false. This is to | 57 // to draw this content and return true. Otherwise return false. This is to |
| 57 // be called after committing scheduled CALayers. | 58 // be called after committing scheduled CALayers. |
| 58 bool CommitFullscreenLowPowerLayer( | 59 bool CommitFullscreenLowPowerLayer( |
| 59 AVSampleBufferDisplayLayer* fullscreen_low_power_layer); | 60 AVSampleBufferDisplayLayer* fullscreen_low_power_layer); |
| 60 | 61 |
| 61 private: | 62 private: |
| 63 class SolidColorContents; |
| 62 struct RootLayer; | 64 struct RootLayer; |
| 63 struct ClipAndSortingLayer; | 65 struct ClipAndSortingLayer; |
| 64 struct TransformLayer; | 66 struct TransformLayer; |
| 65 struct ContentLayer; | 67 struct ContentLayer; |
| 66 friend struct ContentLayer; | 68 friend struct ContentLayer; |
| 67 | 69 |
| 68 struct RootLayer { | 70 struct RootLayer { |
| 69 RootLayer(); | 71 RootLayer(); |
| 70 | 72 |
| 71 // This will remove |ca_layer| from its superlayer, if |ca_layer| is | 73 // This will remove |ca_layer| from its superlayer, if |ca_layer| is |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 ~ContentLayer(); | 156 ~ContentLayer(); |
| 155 void CommitToCA(CALayer* parent, | 157 void CommitToCA(CALayer* parent, |
| 156 ContentLayer* old_layer, | 158 ContentLayer* old_layer, |
| 157 float scale_factor); | 159 float scale_factor); |
| 158 | 160 |
| 159 // Ensure that the IOSurface be marked as in-use as soon as it is received. | 161 // Ensure that the IOSurface be marked as in-use as soon as it is received. |
| 160 // When they are committed to the window server, that will also increment | 162 // When they are committed to the window server, that will also increment |
| 161 // their use count. | 163 // their use count. |
| 162 const gfx::ScopedInUseIOSurface io_surface; | 164 const gfx::ScopedInUseIOSurface io_surface; |
| 163 const base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer; | 165 const base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer; |
| 166 scoped_refptr<SolidColorContents> solid_color_contents; |
| 164 gfx::RectF contents_rect; | 167 gfx::RectF contents_rect; |
| 165 gfx::Rect rect; | 168 gfx::Rect rect; |
| 166 unsigned background_color = 0; | 169 unsigned background_color = 0; |
| 167 // Note that the CoreAnimation edge antialiasing mask is not the same as | 170 // Note that the CoreAnimation edge antialiasing mask is not the same as |
| 168 // the edge antialiasing mask passed to the constructor. | 171 // the edge antialiasing mask passed to the constructor. |
| 169 CAEdgeAntialiasingMask ca_edge_aa_mask = 0; | 172 CAEdgeAntialiasingMask ca_edge_aa_mask = 0; |
| 170 float opacity = 1; | 173 float opacity = 1; |
| 171 NSString* const ca_filter = nil; | 174 NSString* const ca_filter = nil; |
| 172 base::scoped_nsobject<CALayer> ca_layer; | 175 base::scoped_nsobject<CALayer> ca_layer; |
| 173 | 176 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 185 bool has_committed_ = false; | 188 bool has_committed_ = false; |
| 186 const bool allow_av_sample_buffer_display_layer_ = true; | 189 const bool allow_av_sample_buffer_display_layer_ = true; |
| 187 | 190 |
| 188 private: | 191 private: |
| 189 DISALLOW_COPY_AND_ASSIGN(CARendererLayerTree); | 192 DISALLOW_COPY_AND_ASSIGN(CARendererLayerTree); |
| 190 }; | 193 }; |
| 191 | 194 |
| 192 } // namespace ui | 195 } // namespace ui |
| 193 | 196 |
| 194 #endif // UI_ACCELERATED_WIDGET_MAC_CA_LAYER_TREE_MAC_H_ | 197 #endif // UI_ACCELERATED_WIDGET_MAC_CA_LAYER_TREE_MAC_H_ |
| OLD | NEW |