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

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

Issue 1201983006: Clean up usage of SkSurfaceProps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkDevice.h ('k') | include/core/SkSurfaceProps.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
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 const SkIRect& clipBounds() const { return fClipBounds; } 73 const SkIRect& clipBounds() const { return fClipBounds; }
74 Cache* cache() const { return fCache; } 74 Cache* cache() const { return fCache; }
75 private: 75 private:
76 SkMatrix fCTM; 76 SkMatrix fCTM;
77 SkIRect fClipBounds; 77 SkIRect fClipBounds;
78 Cache* fCache; 78 Cache* fCache;
79 }; 79 };
80 80
81 class Proxy { 81 class Proxy {
82 public: 82 public:
83 Proxy(SkBaseDevice* device, const SkSurfaceProps& props) 83 Proxy(SkBaseDevice* device) : fDevice(device) { }
84 : fDevice(device)
85 , fProps(props.flags(), kUnknown_SkPixelGeometry)
86 {}
87 84
88 SkBaseDevice* createDevice(int width, int height); 85 SkBaseDevice* createDevice(int width, int height);
89 // returns true if the proxy handled the filter itself. if this returns 86
87 // Returns true if the proxy handled the filter itself. If this returns
90 // false then the filter's code will be called. 88 // false then the filter's code will be called.
91 bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImag eFilter::Context&, 89 bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImag eFilter::Context&,
92 SkBitmap* result, SkIPoint* offset); 90 SkBitmap* result, SkIPoint* offset);
93 const SkSurfaceProps& surfaceProps() const { return fProps; } 91
94
95 private: 92 private:
96 SkBaseDevice* fDevice; 93 SkBaseDevice* fDevice;
97 const SkSurfaceProps fProps;
98 }; 94 };
99 95
100 96
101 /** 97 /**
102 * Request a new (result) image to be created from the src image. 98 * Request a new (result) image to be created from the src image.
103 * If the src has no pixels (isNull()) then the request just wants to 99 * If the src has no pixels (isNull()) then the request just wants to
104 * receive the config and width/height of the result. 100 * receive the config and width/height of the result.
105 * 101 *
106 * The matrix is the current matrix on the canvas. 102 * The matrix is the current matrix on the canvas.
107 * 103 *
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 */ 362 */
367 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ 363 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \
368 Common localVar; \ 364 Common localVar; \
369 do { \ 365 do { \
370 if (!localVar.unflatten(buffer, expectedCount)) { \ 366 if (!localVar.unflatten(buffer, expectedCount)) { \
371 return NULL; \ 367 return NULL; \
372 } \ 368 } \
373 } while (0) 369 } while (0)
374 370
375 #endif 371 #endif
OLDNEW
« no previous file with comments | « include/core/SkDevice.h ('k') | include/core/SkSurfaceProps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698