OLD | NEW |
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 #include "SkImage_Base.h" | 8 #include "SkImage_Base.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY) con
st override; | 59 bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY) con
st override; |
60 const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const override; | 60 const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const override; |
61 bool getROPixels(SkBitmap*) const override; | 61 bool getROPixels(SkBitmap*) const override; |
62 | 62 |
63 // exposed for SkSurface_Raster via SkNewImageFromPixelRef | 63 // exposed for SkSurface_Raster via SkNewImageFromPixelRef |
64 SkImage_Raster(const SkImageInfo&, SkPixelRef*, const SkIPoint& pixelRefOrig
in, size_t rowBytes, | 64 SkImage_Raster(const SkImageInfo&, SkPixelRef*, const SkIPoint& pixelRefOrig
in, size_t rowBytes, |
65 const SkSurfaceProps*); | 65 const SkSurfaceProps*); |
66 | 66 |
67 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 67 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
68 | 68 |
69 virtual SkShader* onNewShader(SkShader::TileMode, | 69 SkShader* onNewShader(SkShader::TileMode, |
70 SkShader::TileMode, | 70 SkShader::TileMode, |
71 const SkMatrix* localMatrix) const override; | 71 const SkMatrix* localMatrix) const override; |
72 | 72 |
73 bool isOpaque() const override; | 73 bool isOpaque() const override; |
74 | 74 |
75 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) | 75 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) |
76 : INHERITED(bm.width(), bm.height(), props) | 76 : INHERITED(bm.width(), bm.height(), props) |
77 , fBitmap(bm) {} | 77 , fBitmap(bm) {} |
78 | 78 |
79 private: | 79 private: |
80 SkImage_Raster() : INHERITED(0, 0, NULL) {} | 80 SkImage_Raster() : INHERITED(0, 0, NULL) {} |
81 | 81 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { | 231 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { |
232 return ((const SkImage_Raster*)image)->getPixelRef(); | 232 return ((const SkImage_Raster*)image)->getPixelRef(); |
233 } | 233 } |
234 | 234 |
235 bool SkImage_Raster::isOpaque() const { | 235 bool SkImage_Raster::isOpaque() const { |
236 return fBitmap.isOpaque(); | 236 return fBitmap.isOpaque(); |
237 } | 237 } |
238 | 238 |
OLD | NEW |