| 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 "gpu/ipc/service/ca_layer_tree_mac.h" | 5 #include "gpu/ipc/service/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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 if (has_committed_) { | 136 if (has_committed_) { |
| 137 LOG(ERROR) << "ScheduleCALayer called after CommitScheduledCALayers."; | 137 LOG(ERROR) << "ScheduleCALayer called after CommitScheduledCALayers."; |
| 138 return false; | 138 return false; |
| 139 } | 139 } |
| 140 return root_layer_.AddContentLayer(is_clipped, clip_rect, sorting_context_id, | 140 return root_layer_.AddContentLayer(is_clipped, clip_rect, sorting_context_id, |
| 141 transform, io_surface, contents_rect, rect, | 141 transform, io_surface, contents_rect, rect, |
| 142 background_color, edge_aa_mask, opacity); | 142 background_color, edge_aa_mask, opacity); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void CALayerTree::CommitScheduledCALayers(CALayer* superlayer, | 145 void CALayerTree::CommitScheduledCALayers(CALayer* superlayer, |
| 146 scoped_ptr<CALayerTree> old_tree, | 146 std::unique_ptr<CALayerTree> old_tree, |
| 147 float scale_factor) { | 147 float scale_factor) { |
| 148 TRACE_EVENT0("gpu", "CALayerTree::CommitScheduledCALayers"); | 148 TRACE_EVENT0("gpu", "CALayerTree::CommitScheduledCALayers"); |
| 149 RootLayer* old_root_layer = nullptr; | 149 RootLayer* old_root_layer = nullptr; |
| 150 if (old_tree) { | 150 if (old_tree) { |
| 151 DCHECK(old_tree->has_committed_); | 151 DCHECK(old_tree->has_committed_); |
| 152 if (old_tree->scale_factor_ == scale_factor) | 152 if (old_tree->scale_factor_ == scale_factor) |
| 153 old_root_layer = &old_tree->root_layer_; | 153 old_root_layer = &old_tree->root_layer_; |
| 154 } | 154 } |
| 155 | 155 |
| 156 root_layer_.CommitToCA(superlayer, old_root_layer, scale_factor); | 156 root_layer_.CommitToCA(superlayer, old_root_layer, scale_factor); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } else { | 562 } else { |
| 563 // Grey represents a CALayer that has not changed. | 563 // Grey represents a CALayer that has not changed. |
| 564 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); | 564 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); |
| 565 } | 565 } |
| 566 [ca_layer setBorderWidth:1]; | 566 [ca_layer setBorderWidth:1]; |
| 567 [ca_layer setBorderColor:color]; | 567 [ca_layer setBorderColor:color]; |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 | 570 |
| 571 } // namespace gpu | 571 } // namespace gpu |
| OLD | NEW |