| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // exposed for SkSurface_Raster via SkNewImageFromPixelRef | 62 // exposed for SkSurface_Raster via SkNewImageFromPixelRef |
| 63 SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes, const SkSur
faceProps*); | 63 SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes, const SkSur
faceProps*); |
| 64 | 64 |
| 65 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 65 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
| 66 | 66 |
| 67 virtual SkShader* onNewShader(SkShader::TileMode, | 67 virtual SkShader* onNewShader(SkShader::TileMode, |
| 68 SkShader::TileMode, | 68 SkShader::TileMode, |
| 69 const SkMatrix* localMatrix) const SK_OVERRIDE
; | 69 const SkMatrix* localMatrix) const SK_OVERRIDE
; |
| 70 | 70 |
| 71 virtual bool isOpaque() const SK_OVERRIDE; | 71 bool isOpaque() const SK_OVERRIDE; |
| 72 | 72 |
| 73 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) | 73 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) |
| 74 : INHERITED(bm.width(), bm.height(), props) | 74 : INHERITED(bm.width(), bm.height(), props) |
| 75 , fBitmap(bm) {} | 75 , fBitmap(bm) {} |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 SkImage_Raster() : INHERITED(0, 0, NULL) {} | 78 SkImage_Raster() : INHERITED(0, 0, NULL) {} |
| 79 | 79 |
| 80 SkBitmap fBitmap; | 80 SkBitmap fBitmap; |
| 81 | 81 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes, props)); | 194 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes, props)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { | 197 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { |
| 198 return ((const SkImage_Raster*)image)->getPixelRef(); | 198 return ((const SkImage_Raster*)image)->getPixelRef(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 bool SkImage_Raster::isOpaque() const { | 201 bool SkImage_Raster::isOpaque() const { |
| 202 return fBitmap.isOpaque(); | 202 return fBitmap.isOpaque(); |
| 203 } | 203 } |
| OLD | NEW |