Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "cc/paint/paint_flags.h" | |
| 6 | |
| 7 namespace cc { | |
| 8 | |
| 9 bool PaintFlags::IsSimpleOpacity() const { | |
|
vmpstr
2017/03/28 18:27:14
It might be worth adding a comment somewhere in Pa
enne (OOO)
2017/03/28 19:28:05
This function is *on* PaintFlags. It seems like i
| |
| 10 uint32_t color = getColor(); | |
| 11 if (SK_ColorTRANSPARENT != SkColorSetA(color, SK_AlphaTRANSPARENT)) | |
| 12 return false; | |
| 13 if (!isSrcOver()) | |
| 14 return false; | |
| 15 if (getLooper()) | |
| 16 return false; | |
| 17 if (getPathEffect()) | |
| 18 return false; | |
| 19 if (getShader()) | |
| 20 return false; | |
| 21 if (getMaskFilter()) | |
| 22 return false; | |
| 23 if (getColorFilter()) | |
| 24 return false; | |
| 25 if (getImageFilter()) | |
| 26 return false; | |
| 27 return true; | |
| 28 } | |
| 29 | |
| 30 bool PaintFlags::SupportsFoldingAlpha() const { | |
| 31 if (!isSrcOver()) | |
| 32 return false; | |
| 33 if (getColorFilter()) | |
| 34 return false; | |
| 35 if (getImageFilter()) | |
| 36 return false; | |
| 37 if (getLooper()) | |
| 38 return false; | |
| 39 return true; | |
| 40 } | |
| 41 | |
| 42 } // namespace cc | |
| OLD | NEW |