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

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

Issue 1011273003: Move SkMatrixImageFilter into core, and add a factory fn for it. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « gyp/effects.gypi ('k') | include/core/SkMatrixImageFilter.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 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 SkImageFilter_DEFINED 8 #ifndef SkImageFilter_DEFINED
9 #define SkImageFilter_DEFINED 9 #define SkImageFilter_DEFINED
10 10
11 #include "SkFilterQuality.h"
11 #include "SkFlattenable.h" 12 #include "SkFlattenable.h"
12 #include "SkMatrix.h" 13 #include "SkMatrix.h"
13 #include "SkRect.h" 14 #include "SkRect.h"
14 #include "SkTemplates.h" 15 #include "SkTemplates.h"
15 16
16 class SkBitmap; 17 class SkBitmap;
17 class SkColorFilter; 18 class SkColorFilter;
18 class SkBaseDevice; 19 class SkBaseDevice;
19 class SkSurfaceProps; 20 class SkSurfaceProps;
20 struct SkIPoint; 21 struct SkIPoint;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 * should be used to offset access to the input images, and should also 186 * should be used to offset access to the input images, and should also
186 * be added to the "offset" parameter in onFilterImage and 187 * be added to the "offset" parameter in onFilterImage and
187 * filterImageGPU(). (The latter ensures that the resulting buffer is 188 * filterImageGPU(). (The latter ensures that the resulting buffer is
188 * drawn in the correct location.) 189 * drawn in the correct location.)
189 */ 190 */
190 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } 191 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; }
191 192
192 // Default impl returns union of all input bounds. 193 // Default impl returns union of all input bounds.
193 virtual void computeFastBounds(const SkRect&, SkRect*) const; 194 virtual void computeFastBounds(const SkRect&, SkRect*) const;
194 195
196 /**
197 * Create an SkMatrixImageFilter, which transforms its input by the given ma trix.
198 */
199 static SkImageFilter* CreateMatrix(const SkMatrix& matrix,
Stephen White 2015/03/19 18:47:42 BTW, I was thinking of changing this to CreateMatr
reed1 2015/03/19 20:50:01 Agreed, CreateMatrixFilter is more consistent with
200 SkFilterQuality,
201 SkImageFilter* input = NULL);
202
195 #if SK_SUPPORT_GPU 203 #if SK_SUPPORT_GPU
196 /** 204 /**
197 * Wrap the given texture in a texture-backed SkBitmap. 205 * Wrap the given texture in a texture-backed SkBitmap.
198 */ 206 */
199 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result); 207 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result);
200 208
201 /** 209 /**
202 * Recursively evaluate this filter on the GPU. If the filter has no GPU 210 * Recursively evaluate this filter on the GPU. If the filter has no GPU
203 * implementation, it will be processed in software and uploaded to the GPU. 211 * implementation, it will be processed in software and uploaded to the GPU.
204 */ 212 */
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 */ 357 */
350 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ 358 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \
351 Common localVar; \ 359 Common localVar; \
352 do { \ 360 do { \
353 if (!localVar.unflatten(buffer, expectedCount)) { \ 361 if (!localVar.unflatten(buffer, expectedCount)) { \
354 return NULL; \ 362 return NULL; \
355 } \ 363 } \
356 } while (0) 364 } while (0)
357 365
358 #endif 366 #endif
OLDNEW
« no previous file with comments | « gyp/effects.gypi ('k') | include/core/SkMatrixImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698