| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/paint/paint_flags.h" | 5 #include "cc/paint/paint_flags.h" |
| 6 | 6 |
| 7 namespace cc { | 7 namespace cc { |
| 8 | 8 |
| 9 bool PaintFlags::IsSimpleOpacity() const { | 9 bool PaintFlags::IsSimpleOpacity() const { |
| 10 uint32_t color = getColor(); | 10 uint32_t color = getColor(); |
| 11 if (SK_ColorTRANSPARENT != SkColorSetA(color, SK_AlphaTRANSPARENT)) | 11 if (SK_ColorTRANSPARENT != SkColorSetA(color, SK_AlphaTRANSPARENT)) |
| 12 return false; | 12 return false; |
| 13 if (!isSrcOver()) | 13 if (!isSrcOver()) |
| 14 return false; | 14 return false; |
| 15 if (getLooper()) | 15 if (getLooper()) |
| 16 return false; | 16 return false; |
| 17 if (getPathEffect()) | 17 if (getPathEffect()) |
| 18 return false; | 18 return false; |
| 19 if (getShader()) | 19 if (HasShader()) |
| 20 return false; | 20 return false; |
| 21 if (getMaskFilter()) | 21 if (getMaskFilter()) |
| 22 return false; | 22 return false; |
| 23 if (getColorFilter()) | 23 if (getColorFilter()) |
| 24 return false; | 24 return false; |
| 25 if (getImageFilter()) | 25 if (getImageFilter()) |
| 26 return false; | 26 return false; |
| 27 return true; | 27 return true; |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool PaintFlags::SupportsFoldingAlpha() const { | 30 bool PaintFlags::SupportsFoldingAlpha() const { |
| 31 if (!isSrcOver()) | 31 if (!isSrcOver()) |
| 32 return false; | 32 return false; |
| 33 if (getColorFilter()) | 33 if (getColorFilter()) |
| 34 return false; | 34 return false; |
| 35 if (getImageFilter()) | 35 if (getImageFilter()) |
| 36 return false; | 36 return false; |
| 37 if (getLooper()) | 37 if (getLooper()) |
| 38 return false; | 38 return false; |
| 39 return true; | 39 return true; |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace cc | 42 } // namespace cc |
| OLD | NEW |