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

Side by Side Diff: include/core/SkColorFilter.h

Issue 26876002: make explicit the requirement that all colorfilters are reentrant-safe (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/core/SkXfermode.h » ('j') | include/core/SkXfermode.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkColorFilter_DEFINED 10 #ifndef SkColorFilter_DEFINED
11 #define SkColorFilter_DEFINED 11 #define SkColorFilter_DEFINED
12 12
13 #include "SkColor.h" 13 #include "SkColor.h"
14 #include "SkFlattenable.h" 14 #include "SkFlattenable.h"
15 #include "SkXfermode.h" 15 #include "SkXfermode.h"
16 16
17 class SkBitmap; 17 class SkBitmap;
18 class GrEffectRef; 18 class GrEffectRef;
19 class GrContext; 19 class GrContext;
20 20
21 /**
22 * ColorFilters are optional objects in the drawing pipeline. When present in
23 * a paint, they are called with the "src" colors, and return new colors, which
24 * are then passed onto the next stage (either ImageFilter or Xfermode).
25 *
26 * All subclasses are required to be reentrant-safe : it must be legal to share
27 * the same instance between several threads.
28 */
21 class SK_API SkColorFilter : public SkFlattenable { 29 class SK_API SkColorFilter : public SkFlattenable {
22 public: 30 public:
23 SK_DECLARE_INST_COUNT(SkColorFilter) 31 SK_DECLARE_INST_COUNT(SkColorFilter)
24 32
25 /** 33 /**
26 * If the filter can be represented by a source color plus Mode, this 34 * If the filter can be represented by a source color plus Mode, this
27 * returns true, and sets (if not NULL) the color and mode appropriately. 35 * returns true, and sets (if not NULL) the color and mode appropriately.
28 * If not, this returns false and ignores the parameters. 36 * If not, this returns false and ignores the parameters.
29 */ 37 */
30 virtual bool asColorMode(SkColor* color, SkXfermode::Mode* mode) const; 38 virtual bool asColorMode(SkColor* color, SkXfermode::Mode* mode) const;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 133 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
126 protected: 134 protected:
127 SkColorFilter() {} 135 SkColorFilter() {}
128 SkColorFilter(SkFlattenableReadBuffer& rb) : INHERITED(rb) {} 136 SkColorFilter(SkFlattenableReadBuffer& rb) : INHERITED(rb) {}
129 137
130 private: 138 private:
131 typedef SkFlattenable INHERITED; 139 typedef SkFlattenable INHERITED;
132 }; 140 };
133 141
134 #endif 142 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkXfermode.h » ('j') | include/core/SkXfermode.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698