| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual SkShader* onNewShader(SkShader::TileMode, |
| 70 SkShader::TileMode, | 70 SkShader::TileMode, |
| 71 const SkMatrix* localMatrix) const SK_OVERRIDE
; | 71 const SkMatrix* localMatrix) const SK_OVERRIDE
; |
| 72 | 72 |
| 73 bool isOpaque() const SK_OVERRIDE; | 73 bool isOpaque() const SK_OVERRIDE; |
| 74 size_t getSize() const SK_OVERRIDE { return fBitmap.getSize(); } |
| 74 | 75 |
| 75 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) | 76 SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props) |
| 76 : INHERITED(bm.width(), bm.height(), props) | 77 : INHERITED(bm.width(), bm.height(), props) |
| 77 , fBitmap(bm) {} | 78 , fBitmap(bm) {} |
| 78 | 79 |
| 79 private: | 80 private: |
| 80 SkImage_Raster() : INHERITED(0, 0, NULL) {} | 81 SkImage_Raster() : INHERITED(0, 0, NULL) {} |
| 81 | 82 |
| 82 SkBitmap fBitmap; | 83 SkBitmap fBitmap; |
| 83 | 84 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 229 } |
| 229 | 230 |
| 230 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { | 231 const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) { |
| 231 return ((const SkImage_Raster*)image)->getPixelRef(); | 232 return ((const SkImage_Raster*)image)->getPixelRef(); |
| 232 } | 233 } |
| 233 | 234 |
| 234 bool SkImage_Raster::isOpaque() const { | 235 bool SkImage_Raster::isOpaque() const { |
| 235 return fBitmap.isOpaque(); | 236 return fBitmap.isOpaque(); |
| 236 } | 237 } |
| 237 | 238 |
| OLD | NEW |