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

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

Issue 582963002: Solo gp (Closed) Base URL: https://skia.googlesource.com/skia.git@no_peb
Patch Set: rebase 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 | « include/core/SkImageFilter.h ('k') | include/core/SkShader.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 /* 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 SkMaskFilter_DEFINED 10 #ifndef SkMaskFilter_DEFINED
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 @param margin if not null, return the buffer dx/dy need when calculati ng the effect. Used when 56 @param margin if not null, return the buffer dx/dy need when calculati ng the effect. Used when
57 drawing a clipped object to know how much larger to allo cate the src before 57 drawing a clipped object to know how much larger to allo cate the src before
58 applying the filter. If returning false, ignore this par ameter. 58 applying the filter. If returning false, ignore this par ameter.
59 @return true if the dst mask was correctly created. 59 @return true if the dst mask was correctly created.
60 */ 60 */
61 virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&, 61 virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
62 SkIPoint* margin) const; 62 SkIPoint* margin) const;
63 63
64 #if SK_SUPPORT_GPU 64 #if SK_SUPPORT_GPU
65 /** 65 /**
66 * Returns true if the filter can be expressed a single-pass GrEffect witho ut requiring an 66 * Returns true if the filter can be expressed a single-pass GrProcessor wi thout requiring an
67 * explicit input mask. Per-pixel, the effect receives the incoming mask's coverage as 67 * explicit input mask. Per-pixel, the effect receives the incoming mask's coverage as
68 * the input color and outputs the filtered covereage value. This means tha t each pixel's 68 * the input color and outputs the filtered covereage value. This means tha t each pixel's
69 * filtered coverage must only depend on the unfiltered mask value for that pixel and not on 69 * filtered coverage must only depend on the unfiltered mask value for that pixel and not on
70 * surrounding values. 70 * surrounding values.
71 * 71 *
72 * If effect is non-NULL, a new GrEffect instance is stored in it. The calle r assumes ownership 72 * If effect is non-NULL, a new GrProcessor instance is stored in it. The ca ller assumes
73 * of the effect and must unref it. 73 * ownership of the effect and must unref it.
74 */ 74 */
75 virtual bool asNewEffect(GrEffect** effect, 75 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix& ctm) const;
76 GrTexture*,
77 const SkMatrix& ctm) const;
78 76
79 /** 77 /**
80 * If asNewEffect() fails the filter may be implemented on the GPU by a sub class overriding 78 * If asFragmentProcessor() fails the filter may be implemented on the GPU by a subclass
81 * filterMaskGPU (declared below). That code path requires constructing a s rc mask as input. 79 * overriding filterMaskGPU (declared below). That code path requires const ructing a src mask
82 * Since that is a potentially expensive operation, the subclass must also override this 80 * as input. Since that is a potentially expensive operation, the subclass must also override
83 * function to indicate whether filterTextureMaskGPU would succeeed if the mask were to be 81 * this function to indicate whether filterTextureMaskGPU would succeeed if the mask were to be
84 * created. 82 * created.
85 * 83 *
86 * 'maskRect' returns the device space portion of the mask that the filter needs. The mask 84 * 'maskRect' returns the device space portion of the mask that the filter needs. The mask
87 * passed into 'filterMaskGPU' should have the same extent as 'maskRect' bu t be translated 85 * passed into 'filterMaskGPU' should have the same extent as 'maskRect' bu t be translated
88 * to the upper-left corner of the mask (i.e., (maskRect.fLeft, maskRect.fT op) appears at 86 * to the upper-left corner of the mask (i.e., (maskRect.fLeft, maskRect.fT op) appears at
89 * (0, 0) in the mask). 87 * (0, 0) in the mask).
90 */ 88 */
91 virtual bool canFilterMaskGPU(const SkRect& devBounds, 89 virtual bool canFilterMaskGPU(const SkRect& devBounds,
92 const SkIRect& clipBounds, 90 const SkIRect& clipBounds,
93 const SkMatrix& ctm, 91 const SkMatrix& ctm,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 mask and then call filterMask(). If this returns true, the specified blitte r will be called 211 mask and then call filterMask(). If this returns true, the specified blitte r will be called
214 to render that mask. Returns false if filterMask() returned false. 212 to render that mask. Returns false if filterMask() returned false.
215 */ 213 */
216 bool filterRRect(const SkRRect& devRRect, const SkMatrix& ctm, const SkRaste rClip&, 214 bool filterRRect(const SkRRect& devRRect, const SkMatrix& ctm, const SkRaste rClip&,
217 SkBlitter*, SkPaint::Style style) const; 215 SkBlitter*, SkPaint::Style style) const;
218 216
219 typedef SkFlattenable INHERITED; 217 typedef SkFlattenable INHERITED;
220 }; 218 };
221 219
222 #endif 220 #endif
OLDNEW
« no previous file with comments | « include/core/SkImageFilter.h ('k') | include/core/SkShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698