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

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

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/gpu/SkGpuDevice.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 21 matching lines...) Expand all
32 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes, 32 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes,
33 int srcX, int srcY, CachingHint) const; 33 int srcX, int srcY, CachingHint) const;
34 34
35 virtual GrTexture* peekTexture() const { return nullptr; } 35 virtual GrTexture* peekTexture() const { return nullptr; }
36 virtual SkImageCacherator* peekCacherator() const { return nullptr; } 36 virtual SkImageCacherator* peekCacherator() const { return nullptr; }
37 37
38 // return a read-only copy of the pixels. We promise to not modify them, 38 // return a read-only copy of the pixels. We promise to not modify them,
39 // but only inspect them (or encode them). 39 // but only inspect them (or encode them).
40 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0; 40 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0;
41 41
42 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { 42 virtual sk_sp<SkSurface> onNewSurface(const SkImageInfo& info) const {
43 return SkSurface::NewRaster(info); 43 return SkSurface::MakeRaster(info);
44 } 44 }
45 45
46 // Caller must call unref when they are done. 46 // Caller must call unref when they are done.
47 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const = 0; 47 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const = 0;
48 48
49 virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0; 49 virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0;
50 50
51 // If a ctx is specified, then only gpu-specific formats are requested. 51 // If a ctx is specified, then only gpu-specific formats are requested.
52 virtual SkData* onRefEncoded(GrContext*) const { return nullptr; } 52 virtual SkData* onRefEncoded(GrContext*) const { return nullptr; }
53 53
(...skipping 26 matching lines...) Expand all
80 80
81 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { 81 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) {
82 return static_cast<SkImage_Base*>(image.get()); 82 return static_cast<SkImage_Base*>(image.get());
83 } 83 }
84 84
85 static inline const SkImage_Base* as_IB(const SkImage* image) { 85 static inline const SkImage_Base* as_IB(const SkImage* image) {
86 return static_cast<const SkImage_Base*>(image); 86 return static_cast<const SkImage_Base*>(image);
87 } 87 }
88 88
89 #endif 89 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/image/SkImage_Generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698