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

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

Issue 1903483003: Add onImageInfo call to SkImage_Base. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ImageInfo changes. Created 4 years, 8 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 | « no previous file | 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
11 #include "SkAtomics.h" 11 #include "SkAtomics.h"
12 #include "SkImage.h" 12 #include "SkImage.h"
13 #include "SkSurface.h" 13 #include "SkSurface.h"
14 14
15 #include <new> 15 #include <new>
16 16
17 class GrTextureParams; 17 class GrTextureParams;
18 class SkImageCacherator; 18 class SkImageCacherator;
19 19
20 enum { 20 enum {
21 kNeedNewImageUniqueID = 0 21 kNeedNewImageUniqueID = 0
22 }; 22 };
23 23
24 class SkImage_Base : public SkImage { 24 class SkImage_Base : public SkImage {
25 public: 25 public:
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.
30 // Implementors: if you can not return the value, return an invalid ImageInf o with w=0 & h=0
31 // & unknown color space.
32 virtual SkImageInfo onImageInfo() const = 0;
33
29 virtual bool onPeekPixels(SkPixmap*) const { return false; } 34 virtual bool onPeekPixels(SkPixmap*) const { return false; }
30 35
31 // Default impl calls onDraw 36 // Default impl calls onDraw
32 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes, 37 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes,
33 int srcX, int srcY, CachingHint) const; 38 int srcX, int srcY, CachingHint) const;
34 39
35 virtual GrTexture* peekTexture() const { return nullptr; } 40 virtual GrTexture* peekTexture() const { return nullptr; }
36 virtual SkImageCacherator* peekCacherator() const { return nullptr; } 41 virtual SkImageCacherator* peekCacherator() const { return nullptr; }
37 42
38 // return a read-only copy of the pixels. We promise to not modify them, 43 // return a read-only copy of the pixels. We promise to not modify them,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 85
81 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { 86 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) {
82 return static_cast<SkImage_Base*>(image.get()); 87 return static_cast<SkImage_Base*>(image.get());
83 } 88 }
84 89
85 static inline const SkImage_Base* as_IB(const SkImage* image) { 90 static inline const SkImage_Base* as_IB(const SkImage* image) {
86 return static_cast<const SkImage_Base*>(image); 91 return static_cast<const SkImage_Base*>(image);
87 } 92 }
88 93
89 #endif 94 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698