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

Side by Side Diff: src/image/SkImage_Base.h

Issue 821083002: add newImage API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: check when subset == bounds Created 5 years, 11 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 | « src/image/SkImage.cpp ('k') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 SkImage_Base_DEFINED 8 #ifndef SkImage_Base_DEFINED
9 #define SkImage_Base_DEFINED 9 #define SkImage_Base_DEFINED
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 virtual GrTexture* onGetTexture() const { return NULL; } 52 virtual GrTexture* onGetTexture() const { return NULL; }
53 53
54 // return a read-only copy of the pixels. We promise to not modify them, 54 // return a read-only copy of the pixels. We promise to not modify them,
55 // but only inspect them (or encode them). 55 // but only inspect them (or encode them).
56 virtual bool getROPixels(SkBitmap*) const { return false; } 56 virtual bool getROPixels(SkBitmap*) const { return false; }
57 57
58 virtual SkShader* onNewShader(SkShader::TileMode, 58 virtual SkShader* onNewShader(SkShader::TileMode,
59 SkShader::TileMode, 59 SkShader::TileMode,
60 const SkMatrix* localMatrix) const { return NU LL; }; 60 const SkMatrix* localMatrix) const { return NU LL; };
61 61
62 // newWidth > 0, newHeight > 0, subset either NULL or a proper subset of thi s bounds
63 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs et,
64 SkFilterQuality) const;
65
62 private: 66 private:
63 const SkSurfaceProps fProps; 67 const SkSurfaceProps fProps;
64 68
65 typedef SkImage INHERITED; 69 typedef SkImage INHERITED;
66 }; 70 };
67 71
68 static inline SkImage_Base* as_IB(SkImage* image) { 72 static inline SkImage_Base* as_IB(SkImage* image) {
69 return static_cast<SkImage_Base*>(image); 73 return static_cast<SkImage_Base*>(image);
70 } 74 }
71 75
72 static inline const SkImage_Base* as_IB(const SkImage* image) { 76 static inline const SkImage_Base* as_IB(const SkImage* image) {
73 return static_cast<const SkImage_Base*>(image); 77 return static_cast<const SkImage_Base*>(image);
74 } 78 }
75 79
76 #endif 80 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698