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

Side by Side Diff: src/core/SkPaintPriv.h

Issue 663233002: More genericity: overload isPaintOpaque(SkPaint, SkBitmap) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename enum Created 6 years, 2 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 | « no previous file | src/core/SkPaintPriv.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPaintPriv_DEFINED 8 #ifndef SkPaintPriv_DEFINED
9 #define SkPaintPriv_DEFINED 9 #define SkPaintPriv_DEFINED
10 10
11 class SkBitmap; 11 class SkBitmap;
12 class SkPaint; 12 class SkPaint;
13 13
14 #include "SkTypes.h" 14 #include "SkTypes.h"
15
16 enum SkPaintBitmapOpacity {
reed1 2014/10/21 19:44:05 The comments here seem to focus in on "color", but
Rémi Piotaix 2014/10/21 20:01:32 Yes. We need to have this parameter because, is so
17 // No content replaces the paint's color
reed1 2014/10/21 19:44:05 why are these explicitly numbered? In general we d
Rémi Piotaix 2014/10/21 20:01:32 Yes, i forgot to clean it :s Ack
18 kNoBitmap_SkPaintBitmapOpacity = 0,
reed1 2014/10/21 19:44:05 Hmmm, kNoBitmap? I definitely find kTransparent_ v
Rémi Piotaix 2014/10/21 20:01:32 The kNoBitmap is because it happens that the isPai
19 // The color replacement is known to be opaque
20 kOpaque_SkPaintBitmapOpacity = 1,
21 // We have no information about the color or it is transparent
22 kUnknown_SkPaintBitmapOpacity = 2
23 };
24
15 /** Returns true if draw calls that use the paint will completely occlude 25 /** Returns true if draw calls that use the paint will completely occlude
16 canvas contents that are covered by the draw. 26 canvas contents that are covered by the draw.
17 @param paint The paint to be analyzed, NULL is equivalent to 27 @param paint The paint to be analyzed, NULL is equivalent to
28 the default paint.
29 @param contentType The type of the content that will be drawn,
30 kNoBitmap_SkPaintBitmapOpacity if there is no content in adition to the paint.
31 @return true if paint is opaque
32 */
33 bool isPaintOpaque(const SkPaint* paint, SkPaintBitmapOpacity contentType);
34
35 /** Returns true if draw calls that use the paint will completely occlude
36 canvas contents that are covered by the draw.
37 @param paint The paint to be analyzed, NULL is equivalent to
18 the default paint. 38 the default paint.
19 @param bmpReplacesShader a bitmap to be used in place of the paint's 39 @param bmpReplacesShader a bitmap to be used in place of the paint's
20 shader. 40 shader.
21 @return true if paint is opaque 41 @return true if paint is opaque
22 */ 42 */
23 bool isPaintOpaque(const SkPaint* paint, 43 bool isPaintOpaque(const SkPaint* paint,
24 const SkBitmap* bmpReplacesShader = NULL); 44 const SkBitmap* bmpReplacesShader = NULL);
25 #endif 45 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPaintPriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698