| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "cc/layers/picture_image_layer.h" | 7 #include "cc/layers/picture_image_layer.h" |
| 8 #include "cc/layers/solid_color_layer.h" | 8 #include "cc/layers/solid_color_layer.h" |
| 9 #include "cc/paint/paint_image.h" | 9 #include "cc/paint/paint_image.h" |
| 10 #include "cc/test/layer_tree_pixel_resource_test.h" | 10 #include "cc/test/layer_tree_pixel_resource_test.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 opacity = 0.5f; | 215 opacity = 0.5f; |
| 216 } else if (i == kBlendModesCount + 5) { | 216 } else if (i == kBlendModesCount + 5) { |
| 217 blend_mode = SkBlendMode::kDstIn; | 217 blend_mode = SkBlendMode::kDstIn; |
| 218 color = kMiscTransparentColor; | 218 color = kMiscTransparentColor; |
| 219 } | 219 } |
| 220 | 220 |
| 221 scoped_refptr<SolidColorLayer> lane = | 221 scoped_refptr<SolidColorLayer> lane = |
| 222 CreateSolidColorLayer(child_rect, color); | 222 CreateSolidColorLayer(child_rect, color); |
| 223 lane->SetBlendMode(blend_mode); | 223 lane->SetBlendMode(blend_mode); |
| 224 lane->SetOpacity(opacity); | 224 lane->SetOpacity(opacity); |
| 225 lane->SetForceRenderSurfaceForTesting(true); | 225 lane->SetForceRenderSurface(true); |
| 226 // Layers with kDstIn blend mode with a mask is not supported. | 226 // Layers with kDstIn blend mode with a mask is not supported. |
| 227 if (flags & kUseMasks && blend_mode != SkBlendMode::kDstIn) | 227 if (flags & kUseMasks && blend_mode != SkBlendMode::kDstIn) |
| 228 SetupMaskLayer(lane); | 228 SetupMaskLayer(lane); |
| 229 if (flags & kUseColorMatrix) { | 229 if (flags & kUseColorMatrix) { |
| 230 SetupColorMatrix(lane); | 230 SetupColorMatrix(lane); |
| 231 } | 231 } |
| 232 background->AddChild(lane); | 232 background->AddChild(lane); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 RunBlendingWithRenderPass( | 503 RunBlendingWithRenderPass( |
| 504 GL_ZERO_COPY_RECT_DRAW, | 504 GL_ZERO_COPY_RECT_DRAW, |
| 505 FILE_PATH_LITERAL("blending_render_pass_mask.png"), | 505 FILE_PATH_LITERAL("blending_render_pass_mask.png"), |
| 506 kUseMasks | kUseAntialiasing | kUseColorMatrix | kForceShaders); | 506 kUseMasks | kUseAntialiasing | kUseColorMatrix | kForceShaders); |
| 507 } | 507 } |
| 508 | 508 |
| 509 } // namespace | 509 } // namespace |
| 510 } // namespace cc | 510 } // namespace cc |
| 511 | 511 |
| 512 #endif // OS_ANDROID | 512 #endif // OS_ANDROID |
| OLD | NEW |