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

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

Issue 1352293002: Revert[2] of add ImageShader, sharing code with its Bitmap cousin (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 virtual GrTexture* peekTexture() const { return nullptr; } 48 virtual GrTexture* peekTexture() const { return nullptr; }
49 49
50 // return a read-only copy of the pixels. We promise to not modify them, 50 // return a read-only copy of the pixels. We promise to not modify them,
51 // but only inspect them (or encode them). 51 // but only inspect them (or encode them).
52 virtual bool getROPixels(SkBitmap*) const = 0; 52 virtual bool getROPixels(SkBitmap*) const = 0;
53 53
54 // Caller must call unref when they are done. 54 // Caller must call unref when they are done.
55 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0; 55 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0;
56 56
57 virtual SkShader* onNewShader(SkShader::TileMode, 57 virtual SkImage* onNewSubset(const SkIRect&) const = 0;
58 SkShader::TileMode,
59 const SkMatrix* localMatrix) const { return nu llptr; }
60 58
61 virtual SkImage* onNewSubset(const SkIRect&) const = 0;
62 virtual SkData* onRefEncoded() const { return nullptr; } 59 virtual SkData* onRefEncoded() const { return nullptr; }
63 60
64 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; 61 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const;
65 62
66 virtual bool onIsLazyGenerated() const { return false; } 63 virtual bool onIsLazyGenerated() const { return false; }
67 64
68 // Call when this image is part of the key to a resourcecache entry. This al lows the cache 65 // Call when this image is part of the key to a resourcecache entry. This al lows the cache
69 // to know automatically those entries can be purged when this SkImage delet ed. 66 // to know automatically those entries can be purged when this SkImage delet ed.
70 void notifyAddedToCache() const { 67 void notifyAddedToCache() const {
71 fAddedToCache.store(true); 68 fAddedToCache.store(true);
(...skipping 10 matching lines...) Expand all
82 79
83 static inline SkImage_Base* as_IB(SkImage* image) { 80 static inline SkImage_Base* as_IB(SkImage* image) {
84 return static_cast<SkImage_Base*>(image); 81 return static_cast<SkImage_Base*>(image);
85 } 82 }
86 83
87 static inline const SkImage_Base* as_IB(const SkImage* image) { 84 static inline const SkImage_Base* as_IB(const SkImage* image) {
88 return static_cast<const SkImage_Base*>(image); 85 return static_cast<const SkImage_Base*>(image);
89 } 86 }
90 87
91 #endif 88 #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