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

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

Issue 1128823010: Revert of antialias matrix-image-filter to get smooth diagonals (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/SkCanvas.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 private: 74 private:
75 SkMatrix fCTM; 75 SkMatrix fCTM;
76 SkIRect fClipBounds; 76 SkIRect fClipBounds;
77 Cache* fCache; 77 Cache* fCache;
78 }; 78 };
79 79
80 class Proxy { 80 class Proxy {
81 public: 81 public:
82 virtual ~Proxy() {}; 82 virtual ~Proxy() {};
83 83
84 /**
85 * The returned device will be zero-initialized (transparent black)
86 */
87 virtual SkBaseDevice* createDevice(int width, int height) = 0; 84 virtual SkBaseDevice* createDevice(int width, int height) = 0;
88 // returns true if the proxy can handle this filter natively 85 // returns true if the proxy can handle this filter natively
89 virtual bool canHandleImageFilter(const SkImageFilter*) = 0; 86 virtual bool canHandleImageFilter(const SkImageFilter*) = 0;
90 // returns true if the proxy handled the filter itself. if this returns 87 // returns true if the proxy handled the filter itself. if this returns
91 // false then the filter's code will be called. 88 // false then the filter's code will be called.
92 virtual bool filterImage(const SkImageFilter*, const SkBitmap& src, 89 virtual bool filterImage(const SkImageFilter*, const SkBitmap& src,
93 const Context&, 90 const Context&,
94 SkBitmap* result, SkIPoint* offset) = 0; 91 SkBitmap* result, SkIPoint* offset) = 0;
95 virtual const SkSurfaceProps* surfaceProps() const = 0; 92 virtual const SkSurfaceProps* surfaceProps() const = 0;
96 }; 93 };
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 * parameters before they are used in the effect. Note that this function 337 * parameters before they are used in the effect. Note that this function
341 * will be called with (NULL, NULL, SkMatrix::I()) to query for support, 338 * will be called with (NULL, NULL, SkMatrix::I()) to query for support,
342 * so returning "true" indicates support for all possible matrices. 339 * so returning "true" indicates support for all possible matrices.
343 */ 340 */
344 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix&, 341 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix&,
345 const SkIRect& bounds) const; 342 const SkIRect& bounds) const;
346 343
347 private: 344 private:
348 bool usesSrcInput() const { return fUsesSrcInput; } 345 bool usesSrcInput() const { return fUsesSrcInput; }
349 346
350 // Hack to optimize how we saveLayer, remove when no longer needed by SkCanv as
351 bool mayDrawWithMatrix() const { return this->onMayDrawWithMatrix(); }
352 // Return true if the subclass may draw the src transformed (e.g. w/ matrix)
353 virtual bool onMayDrawWithMatrix() const { return false; }
354 friend class SkCanvas;
355
356 typedef SkFlattenable INHERITED; 347 typedef SkFlattenable INHERITED;
357 int fInputCount; 348 int fInputCount;
358 SkImageFilter** fInputs; 349 SkImageFilter** fInputs;
359 bool fUsesSrcInput; 350 bool fUsesSrcInput;
360 CropRect fCropRect; 351 CropRect fCropRect;
361 uint32_t fUniqueID; // Globally unique 352 uint32_t fUniqueID; // Globally unique
362 }; 353 };
363 354
364 /** 355 /**
365 * Helper to unflatten the common data, and return NULL if we fail. 356 * Helper to unflatten the common data, and return NULL if we fail.
366 */ 357 */
367 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ 358 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \
368 Common localVar; \ 359 Common localVar; \
369 do { \ 360 do { \
370 if (!localVar.unflatten(buffer, expectedCount)) { \ 361 if (!localVar.unflatten(buffer, expectedCount)) { \
371 return NULL; \ 362 return NULL; \
372 } \ 363 } \
373 } while (0) 364 } while (0)
374 365
375 #endif 366 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698