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

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

Issue 1463373002: scaling API on SkPixmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 11 matching lines...) Expand all
22 22
23 class SkImage_Base : public SkImage { 23 class SkImage_Base : public SkImage {
24 public: 24 public:
25 SkImage_Base(int width, int height, uint32_t uniqueID); 25 SkImage_Base(int width, int height, uint32_t uniqueID);
26 virtual ~SkImage_Base(); 26 virtual ~SkImage_Base();
27 27
28 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const { return nullptr; } 28 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const { return nullptr; }
29 29
30 // Default impl calls onDraw 30 // Default impl calls onDraw
31 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes, 31 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_ t dstRowBytes,
32 int srcX, int srcY) const; 32 int srcX, int srcY, CachingHint) const;
33 33
34 virtual GrTexture* peekTexture() const { return nullptr; } 34 virtual GrTexture* peekTexture() const { return nullptr; }
35 35
36 // return a read-only copy of the pixels. We promise to not modify them, 36 // return a read-only copy of the pixels. We promise to not modify them,
37 // but only inspect them (or encode them). 37 // but only inspect them (or encode them).
38 virtual bool getROPixels(SkBitmap*) const = 0; 38 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0;
39 39
40 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, 40 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset,
41 bool forceResultToOriginalSize) const; 41 bool forceResultToOriginalSize) const;
42 42
43 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { 43 virtual SkSurface* onNewSurface(const SkImageInfo& info) const {
44 return SkSurface::NewRaster(info); 44 return SkSurface::NewRaster(info);
45 } 45 }
46 46
47 // Caller must call unref when they are done. 47 // Caller must call unref when they are done.
48 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const = 0; 48 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const = 0;
(...skipping 21 matching lines...) Expand all
70 70
71 static inline SkImage_Base* as_IB(SkImage* image) { 71 static inline SkImage_Base* as_IB(SkImage* image) {
72 return static_cast<SkImage_Base*>(image); 72 return static_cast<SkImage_Base*>(image);
73 } 73 }
74 74
75 static inline const SkImage_Base* as_IB(const SkImage* image) { 75 static inline const SkImage_Base* as_IB(const SkImage* image) {
76 return static_cast<const SkImage_Base*>(image); 76 return static_cast<const SkImage_Base*>(image);
77 } 77 }
78 78
79 #endif 79 #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