| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/layers/render_surface_impl.h" | 5 #include "cc/layers/render_surface_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 OwningEffectNode()->surface_contents_scale; | 399 OwningEffectNode()->surface_contents_scale; |
| 400 PictureLayerImpl* mask_layer = static_cast<PictureLayerImpl*>(MaskLayer()); | 400 PictureLayerImpl* mask_layer = static_cast<PictureLayerImpl*>(MaskLayer()); |
| 401 if (mask_layer && mask_layer->DrawsContent() && | 401 if (mask_layer && mask_layer->DrawsContent() && |
| 402 !mask_layer->bounds().IsEmpty()) { | 402 !mask_layer->bounds().IsEmpty()) { |
| 403 // The software renderer applies mask layer and blending in the wrong | 403 // The software renderer applies mask layer and blending in the wrong |
| 404 // order but kDstIn doesn't commute with masking. It is okay to not | 404 // order but kDstIn doesn't commute with masking. It is okay to not |
| 405 // support this configuration because kDstIn was introduced to replace | 405 // support this configuration because kDstIn was introduced to replace |
| 406 // mask layers. | 406 // mask layers. |
| 407 DCHECK(BlendMode() != SkBlendMode::kDstIn) | 407 DCHECK(BlendMode() != SkBlendMode::kDstIn) |
| 408 << "kDstIn blend mode with mask layer is unsupported."; | 408 << "kDstIn blend mode with mask layer is unsupported."; |
| 409 TRACE_EVENT1("cc", "RenderSurfaceImpl::AppendQuads", |
| 410 "mask_layer_gpu_memory_usage", |
| 411 mask_layer->GPUMemoryUsageInBytes()); |
| 409 if (mask_layer->mask_type() == Layer::LayerMaskType::MULTI_TEXTURE_MASK) { | 412 if (mask_layer->mask_type() == Layer::LayerMaskType::MULTI_TEXTURE_MASK) { |
| 410 TileMaskLayer(render_pass, shared_quad_state, visible_layer_rect); | 413 TileMaskLayer(render_pass, shared_quad_state, visible_layer_rect); |
| 411 return; | 414 return; |
| 412 } | 415 } |
| 413 gfx::SizeF mask_uv_size; | 416 gfx::SizeF mask_uv_size; |
| 414 mask_layer->GetContentsResourceId(&mask_resource_id, &mask_texture_size, | 417 mask_layer->GetContentsResourceId(&mask_resource_id, &mask_texture_size, |
| 415 &mask_uv_size); | 418 &mask_uv_size); |
| 416 gfx::SizeF unclipped_mask_target_size = gfx::ScaleSize( | 419 gfx::SizeF unclipped_mask_target_size = gfx::ScaleSize( |
| 417 gfx::SizeF(OwningEffectNode()->unscaled_mask_target_size), | 420 gfx::SizeF(OwningEffectNode()->unscaled_mask_target_size), |
| 418 surface_contents_scale.x(), surface_contents_scale.y()); | 421 surface_contents_scale.x(), surface_contents_scale.y()); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 NOTIMPLEMENTED(); | 541 NOTIMPLEMENTED(); |
| 539 break; | 542 break; |
| 540 default: | 543 default: |
| 541 NOTREACHED(); | 544 NOTREACHED(); |
| 542 break; | 545 break; |
| 543 } | 546 } |
| 544 } | 547 } |
| 545 } | 548 } |
| 546 | 549 |
| 547 } // namespace cc | 550 } // namespace cc |
| OLD | NEW |