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

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

Issue 2197323002: implement isABitmap for imageshader, return localmatrix for bitmap's impl (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add isAImage api Created 4 years, 4 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_Raster.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 15 matching lines...) Expand all
26 SkImage_Base(int width, int height, uint32_t uniqueID); 26 SkImage_Base(int width, int height, uint32_t uniqueID);
27 virtual ~SkImage_Base(); 27 virtual ~SkImage_Base();
28 28
29 // User: returns image info for this SkImage. 29 // User: returns image info for this SkImage.
30 // Implementors: if you can not return the value, return an invalid ImageInf o with w=0 & h=0 30 // Implementors: if you can not return the value, return an invalid ImageInf o with w=0 & h=0
31 // & unknown color space. 31 // & unknown color space.
32 virtual SkImageInfo onImageInfo() const = 0; 32 virtual SkImageInfo onImageInfo() const = 0;
33 33
34 virtual bool onPeekPixels(SkPixmap*) const { return false; } 34 virtual bool onPeekPixels(SkPixmap*) const { return false; }
35 35
36 virtual const SkBitmap* onPeekBitmap() const { return nullptr; }
37
36 // Default impl calls onDraw 38 // Default impl calls onDraw
37 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes, 39 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes,
38 int srcX, int srcY, CachingHint) const; 40 int srcX, int srcY, CachingHint) const;
39 41
40 virtual GrTexture* peekTexture() const { return nullptr; } 42 virtual GrTexture* peekTexture() const { return nullptr; }
41 virtual SkImageCacherator* peekCacherator() const { return nullptr; } 43 virtual SkImageCacherator* peekCacherator() const { return nullptr; }
42 44
43 // return a read-only copy of the pixels. We promise to not modify them, 45 // return a read-only copy of the pixels. We promise to not modify them,
44 // but only inspect them (or encode them). 46 // but only inspect them (or encode them).
45 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0; 47 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 82
81 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { 83 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) {
82 return static_cast<SkImage_Base*>(image.get()); 84 return static_cast<SkImage_Base*>(image.get());
83 } 85 }
84 86
85 static inline const SkImage_Base* as_IB(const SkImage* image) { 87 static inline const SkImage_Base* as_IB(const SkImage* image) {
86 return static_cast<const SkImage_Base*>(image); 88 return static_cast<const SkImage_Base*>(image);
87 } 89 }
88 90
89 #endif 91 #endif
OLDNEW
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698