Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: cc/paint/paint_flags.cc

Issue 2893083002: cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: update Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/paint/paint_flags.h ('k') | cc/paint/paint_op_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « cc/paint/paint_flags.h ('k') | cc/paint/paint_op_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698