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

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

Issue 1355863002: Revert of add ImageShader, sharing code with its Bitmap cousin (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/SkImageShader.cpp ('k') | src/image/SkImage_Generator.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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 virtual GrTexture* peekTexture() const { return nullptr; } 50 virtual GrTexture* peekTexture() const { return nullptr; }
51 51
52 // return a read-only copy of the pixels. We promise to not modify them, 52 // return a read-only copy of the pixels. We promise to not modify them,
53 // but only inspect them (or encode them). 53 // but only inspect them (or encode them).
54 virtual bool getROPixels(SkBitmap*) const = 0; 54 virtual bool getROPixels(SkBitmap*) const = 0;
55 55
56 // Caller must call unref when they are done. 56 // Caller must call unref when they are done.
57 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0; 57 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0;
58 58
59 virtual SkShader* onNewShader(SkShader::TileMode,
60 SkShader::TileMode,
61 const SkMatrix* localMatrix) const { return nu llptr; }
62
59 // newWidth > 0, newHeight > 0, subset either nullptr or a proper subset of this bounds 63 // newWidth > 0, newHeight > 0, subset either nullptr or a proper subset of this bounds
60 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs et, 64 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs et,
61 SkFilterQuality) const; 65 SkFilterQuality) const;
62 virtual SkData* onRefEncoded() const { return nullptr; } 66 virtual SkData* onRefEncoded() const { return nullptr; }
63 67
64 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; 68 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const;
65 69
66 virtual bool onIsLazyGenerated() const { return false; } 70 virtual bool onIsLazyGenerated() const { return false; }
67 71
68 // Call when this image is part of the key to a resourcecache entry. This al lows the cache 72 // Call when this image is part of the key to a resourcecache entry. This al lows the cache
(...skipping 13 matching lines...) Expand all
82 86
83 static inline SkImage_Base* as_IB(SkImage* image) { 87 static inline SkImage_Base* as_IB(SkImage* image) {
84 return static_cast<SkImage_Base*>(image); 88 return static_cast<SkImage_Base*>(image);
85 } 89 }
86 90
87 static inline const SkImage_Base* as_IB(const SkImage* image) { 91 static inline const SkImage_Base* as_IB(const SkImage* image) {
88 return static_cast<const SkImage_Base*>(image); 92 return static_cast<const SkImage_Base*>(image);
89 } 93 }
90 94
91 #endif 95 #endif
OLDNEW
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698