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 "SkImagePriv.h" | 9 #include "SkImagePriv.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // exposed for SkSurface_Raster via SkNewImageFromPixelRef | 63 // exposed for SkSurface_Raster via SkNewImageFromPixelRef |
64 SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes, const SkSur
faceProps*); | 64 SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes, const SkSur
faceProps*); |
65 | 65 |
66 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 66 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
67 | 67 |
68 virtual SkShader* onNewShader(SkShader::TileMode, | 68 virtual SkShader* onNewShader(SkShader::TileMode, |
69 SkShader::TileMode, | 69 SkShader::TileMode, |
70 const SkMatrix* localMatrix) const SK_OVERRIDE
; | 70 const SkMatrix* localMatrix) const SK_OVERRIDE
; |
71 | 71 |
72 bool isOpaque() const SK_OVERRIDE; | 72 bool isOpaque() const SK_OVERRIDE; |
| 73 size_t getSize() const SK_OVERRIDE { return fBitmap.getSize(); } |
73 | 74 |
74 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) | 75 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) |
75 : INHERITED(bm.width(), bm.height(), props) | 76 : INHERITED(bm.width(), bm.height(), props) |
76 , fBitmap(bm) {} | 77 , fBitmap(bm) {} |
77 | 78 |
| 79 |
78 private: | 80 private: |
79 SkImage_Raster() : INHERITED(0, 0, NULL) {} | 81 SkImage_Raster() : INHERITED(0, 0, NULL) {} |
80 | 82 |
81 SkBitmap fBitmap; | 83 SkBitmap fBitmap; |
82 | 84 |
83 typedef SkImage_Base INHERITED; | 85 typedef SkImage_Base INHERITED; |
84 }; | 86 }; |
85 | 87 |
86 /////////////////////////////////////////////////////////////////////////////// | 88 /////////////////////////////////////////////////////////////////////////////// |
87 | 89 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 211 } |
210 | 212 |
211 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { | 213 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { |
212 return ((const SkImage_Raster*)image)->getPixelRef(); | 214 return ((const SkImage_Raster*)image)->getPixelRef(); |
213 } | 215 } |
214 | 216 |
215 bool SkImage_Raster::isOpaque() const { | 217 bool SkImage_Raster::isOpaque() const { |
216 return fBitmap.isOpaque(); | 218 return fBitmap.isOpaque(); |
217 } | 219 } |
218 | 220 |
OLD | NEW |