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

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

Issue 196353021: Revert "Implement support for expanding crop rects in image filters" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « gyp/gmslides.gypi ('k') | src/core/SkImageFilter.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 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
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 SkBitmap* result, SkIPoint* offset) const; 216 SkBitmap* result, SkIPoint* offset) const;
217 // Given the bounds of the destination rect to be filled in device 217 // Given the bounds of the destination rect to be filled in device
218 // coordinates (first parameter), and the CTM, compute (conservatively) 218 // coordinates (first parameter), and the CTM, compute (conservatively)
219 // which rect of the source image would be required (third parameter). 219 // which rect of the source image would be required (third parameter).
220 // Used for clipping and temp-buffer allocations, so the result need not 220 // Used for clipping and temp-buffer allocations, so the result need not
221 // be exact, but should never be smaller than the real answer. The default 221 // be exact, but should never be smaller than the real answer. The default
222 // implementation recursively unions all input bounds, or returns false if 222 // implementation recursively unions all input bounds, or returns false if
223 // no inputs. 223 // no inputs.
224 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const ; 224 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const ;
225 225
226 /** Computes source bounds as the src bitmap bounds offset by srcOffset. 226 // Applies "matrix" to the crop rect, and sets "rect" to the intersection of
227 * Apply the transformed crop rect to the bounds if any of the 227 // "rect" and the transformed crop rect. If there is no overlap, returns
228 * corresponding edge flags are set. Intersects the result against the 228 // false and leaves "rect" unchanged.
229 * context's clipBounds, and returns the result in "bounds". If there is 229 bool applyCropRect(SkIRect* rect, const SkMatrix& matrix) const;
230 * no intersection, returns false and leaves "bounds" unchanged.
231 */
232 bool applyCropRect(const Context&, const SkBitmap& src, const SkIPoint& srcO ffset,
233 SkIRect* bounds) const;
234
235 /** Same as the above call, except that if the resulting crop rect is not
236 * entirely contained by the source bitmap's bounds, it creates a new
237 * bitmap in "result" and pads the edges with transparent black. In that
238 * case, the srcOffset is modified to be the same as the bounds, since no
239 * further adjustment is needed by the caller. This version should only
240 * be used by filters which are not capable of processing a smaller
241 * source bitmap into a larger destination.
242 */
243 bool applyCropRect(const Context&, Proxy* proxy, const SkBitmap& src, SkIPoi nt* srcOffset,
244 SkIRect* bounds, SkBitmap* result) const;
245 230
246 /** 231 /**
247 * Returns true if the filter can be expressed a single-pass 232 * Returns true if the filter can be expressed a single-pass
248 * GrEffect, used to process this filter on the GPU, or false if 233 * GrEffect, used to process this filter on the GPU, or false if
249 * not. 234 * not.
250 * 235 *
251 * If effect is non-NULL, a new GrEffect instance is stored 236 * If effect is non-NULL, a new GrEffect instance is stored
252 * in it. The caller assumes ownership of the stage, and it is up to the 237 * in it. The caller assumes ownership of the stage, and it is up to the
253 * caller to unref it. 238 * caller to unref it.
254 * 239 *
(...skipping 10 matching lines...) Expand all
265 250
266 251
267 private: 252 private:
268 typedef SkFlattenable INHERITED; 253 typedef SkFlattenable INHERITED;
269 int fInputCount; 254 int fInputCount;
270 SkImageFilter** fInputs; 255 SkImageFilter** fInputs;
271 CropRect fCropRect; 256 CropRect fCropRect;
272 }; 257 };
273 258
274 #endif 259 #endif
OLDNEW
« no previous file with comments | « gyp/gmslides.gypi ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698