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

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

Issue 2337803002: Don't copy image buffer when calculating size.
Patch Set: Making SkImage_Gpu always return false. Created 4 years, 1 month 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/core/SkImageCacherator.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 28 matching lines...) Expand all
39 virtual bool onPeekPixels(SkPixmap*) const { return false; } 39 virtual bool onPeekPixels(SkPixmap*) const { return false; }
40 40
41 virtual const SkBitmap* onPeekBitmap() const { return nullptr; } 41 virtual const SkBitmap* onPeekBitmap() const { return nullptr; }
42 42
43 // Default impl calls onDraw 43 // Default impl calls onDraw
44 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes, 44 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes,
45 int srcX, int srcY, CachingHint) const; 45 int srcX, int srcY, CachingHint) const;
46 46
47 virtual GrTexture* peekTexture() const { return nullptr; } 47 virtual GrTexture* peekTexture() const { return nullptr; }
48 #if SK_SUPPORT_GPU 48 #if SK_SUPPORT_GPU
49 virtual bool canGenerateTexture(const GrContextThreadSafeProxy& proxy) const { return false; }
50
49 virtual sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const { return nullptr; } 51 virtual sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const { return nullptr; }
50 #endif 52 #endif
51 virtual SkImageCacherator* peekCacherator() const { return nullptr; } 53 virtual SkImageCacherator* peekCacherator() const { return nullptr; }
52 54
53 // return a read-only copy of the pixels. We promise to not modify them, 55 // return a read-only copy of the pixels. We promise to not modify them,
54 // but only inspect them (or encode them). 56 // but only inspect them (or encode them).
55 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0; 57 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0;
56 58
57 // Caller must call unref when they are done. 59 // Caller must call unref when they are done.
58 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&, 60 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&,
(...skipping 30 matching lines...) Expand all
89 91
90 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { 92 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) {
91 return static_cast<SkImage_Base*>(image.get()); 93 return static_cast<SkImage_Base*>(image.get());
92 } 94 }
93 95
94 static inline const SkImage_Base* as_IB(const SkImage* image) { 96 static inline const SkImage_Base* as_IB(const SkImage* image) {
95 return static_cast<const SkImage_Base*>(image); 97 return static_cast<const SkImage_Base*>(image);
96 } 98 }
97 99
98 #endif 100 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698