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

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

Issue 1556333004: take gr-context parameter to refEncoded, indicating a desire for only gpu-specific formats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 4 years, 11 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { 45 virtual SkSurface* onNewSurface(const SkImageInfo& info) const {
46 return SkSurface::NewRaster(info); 46 return SkSurface::NewRaster(info);
47 } 47 }
48 48
49 // Caller must call unref when they are done. 49 // Caller must call unref when they are done.
50 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const = 0; 50 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const = 0;
51 51
52 virtual SkImage* onNewSubset(const SkIRect&) const = 0; 52 virtual SkImage* onNewSubset(const SkIRect&) const = 0;
53 53
54 virtual SkData* onRefEncoded() const { return nullptr; } 54 // If a ctx is specified, then only gpu-specific formats are requested.
55 virtual SkData* onRefEncoded(GrContext*) const { return nullptr; }
55 56
56 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; 57 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const;
57 58
58 virtual bool onIsLazyGenerated() const { return false; } 59 virtual bool onIsLazyGenerated() const { return false; }
59 60
60 // Return a bitmap suitable for passing to image-filters 61 // Return a bitmap suitable for passing to image-filters
61 // For now, that means wrapping textures into SkGrPixelRefs... 62 // For now, that means wrapping textures into SkGrPixelRefs...
62 virtual bool asBitmapForImageFilters(SkBitmap* bitmap) const { 63 virtual bool asBitmapForImageFilters(SkBitmap* bitmap) const {
63 return this->getROPixels(bitmap, kAllow_CachingHint); 64 return this->getROPixels(bitmap, kAllow_CachingHint);
64 } 65 }
(...skipping 13 matching lines...) Expand all
78 79
79 static inline SkImage_Base* as_IB(SkImage* image) { 80 static inline SkImage_Base* as_IB(SkImage* image) {
80 return static_cast<SkImage_Base*>(image); 81 return static_cast<SkImage_Base*>(image);
81 } 82 }
82 83
83 static inline const SkImage_Base* as_IB(const SkImage* image) { 84 static inline const SkImage_Base* as_IB(const SkImage* image) {
84 return static_cast<const SkImage_Base*>(image); 85 return static_cast<const SkImage_Base*>(image);
85 } 86 }
86 87
87 #endif 88 #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