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

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

Issue 2250663002: Add alphaType() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@special-image-alpha-type
Patch Set: Remove virtuals from SkImage, slight cleanup 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/SkImage.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 13 matching lines...) Expand all
24 24
25 class SkImage_Base : public SkImage { 25 class SkImage_Base : public SkImage {
26 public: 26 public:
27 SkImage_Base(int width, int height, uint32_t uniqueID); 27 SkImage_Base(int width, int height, uint32_t uniqueID);
28 virtual ~SkImage_Base(); 28 virtual ~SkImage_Base();
29 29
30 // User: returns image info for this SkImage. 30 // User: returns image info for this SkImage.
31 // Implementors: if you can not return the value, return an invalid ImageInf o with w=0 & h=0 31 // Implementors: if you can not return the value, return an invalid ImageInf o with w=0 & h=0
32 // & unknown color space. 32 // & unknown color space.
33 virtual SkImageInfo onImageInfo() const = 0; 33 virtual SkImageInfo onImageInfo() const = 0;
34 virtual SkAlphaType onAlphaType() const = 0;
34 35
35 virtual bool onPeekPixels(SkPixmap*) const { return false; } 36 virtual bool onPeekPixels(SkPixmap*) const { return false; }
36 37
37 virtual const SkBitmap* onPeekBitmap() const { return nullptr; } 38 virtual const SkBitmap* onPeekBitmap() const { return nullptr; }
38 39
39 // Default impl calls onDraw 40 // Default impl calls onDraw
40 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes, 41 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes,
41 int srcX, int srcY, CachingHint) const; 42 int srcX, int srcY, CachingHint) const;
42 43
43 virtual GrTexture* peekTexture() const { return nullptr; } 44 virtual GrTexture* peekTexture() const { return nullptr; }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 88
88 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { 89 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) {
89 return static_cast<SkImage_Base*>(image.get()); 90 return static_cast<SkImage_Base*>(image.get());
90 } 91 }
91 92
92 static inline const SkImage_Base* as_IB(const SkImage* image) { 93 static inline const SkImage_Base* as_IB(const SkImage* image) {
93 return static_cast<const SkImage_Base*>(image); 94 return static_cast<const SkImage_Base*>(image);
94 } 95 }
95 96
96 #endif 97 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698