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 "content/common/gpu/ca_layer_tree_mac.h" | 5 #include "content/common/gpu/ca_layer_tree_mac.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 void CALayerTree::ClipAndSortingLayer::CommitToCA( | 296 void CALayerTree::ClipAndSortingLayer::CommitToCA( |
297 CALayer* superlayer, | 297 CALayer* superlayer, |
298 ClipAndSortingLayer* old_layer, | 298 ClipAndSortingLayer* old_layer, |
299 float scale_factor) { | 299 float scale_factor) { |
300 bool update_is_clipped = true; | 300 bool update_is_clipped = true; |
301 bool update_clip_rect = true; | 301 bool update_clip_rect = true; |
302 if (old_layer) { | 302 if (old_layer) { |
303 DCHECK(old_layer->ca_layer); | 303 DCHECK(old_layer->ca_layer); |
304 std::swap(ca_layer, old_layer->ca_layer); | 304 std::swap(ca_layer, old_layer->ca_layer); |
305 update_is_clipped = old_layer->is_clipped != is_clipped; | 305 update_is_clipped = old_layer->is_clipped != is_clipped; |
306 update_clip_rect = old_layer->clip_rect != clip_rect; | 306 update_clip_rect = update_is_clipped || old_layer->clip_rect != clip_rect; |
ccameron
2016/02/17 22:53:33
Oops, tests discovered a bug.
| |
307 } else { | 307 } else { |
308 ca_layer.reset([[CALayer alloc] init]); | 308 ca_layer.reset([[CALayer alloc] init]); |
309 [ca_layer setAnchorPoint:CGPointZero]; | 309 [ca_layer setAnchorPoint:CGPointZero]; |
310 [superlayer addSublayer:ca_layer]; | 310 [superlayer addSublayer:ca_layer]; |
311 } | 311 } |
312 // Excessive logging to debug white screens (crbug.com/583805). | 312 // Excessive logging to debug white screens (crbug.com/583805). |
313 // TODO(ccameron): change this back to a DCHECK. | 313 // TODO(ccameron): change this back to a DCHECK. |
314 if ([ca_layer superlayer] != superlayer) { | 314 if ([ca_layer superlayer] != superlayer) { |
315 LOG(ERROR) << "CALayerTree root layer not attached to tree."; | 315 LOG(ERROR) << "CALayerTree root layer not attached to tree."; |
316 } | 316 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 } else { | 446 } else { |
447 // Grey represents a CALayer that has not changed. | 447 // Grey represents a CALayer that has not changed. |
448 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); | 448 color.reset(CGColorCreateGenericRGB(0, 0, 0, 0.1)); |
449 } | 449 } |
450 [ca_layer setBorderWidth:1]; | 450 [ca_layer setBorderWidth:1]; |
451 [ca_layer setBorderColor:color]; | 451 [ca_layer setBorderColor:color]; |
452 } | 452 } |
453 } | 453 } |
454 | 454 |
455 } // namespace content | 455 } // namespace content |
OLD | NEW |