| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const S
K_OVERRIDE; | 59 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const S
K_OVERRIDE; |
| 60 virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE; | 60 virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE; |
| 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); | 63 SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes); |
| 64 | 64 |
| 65 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 65 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
| 66 | 66 |
| 67 virtual SkShader* onNewShader(SkShader::TileMode, SkShader::TileMode) const
SK_OVERRIDE; | 67 virtual SkShader* onNewShader(SkShader::TileMode, SkShader::TileMode) const
SK_OVERRIDE; |
| 68 | 68 |
| 69 virtual bool isOpaque() const SK_OVERRIDE; |
| 70 |
| 69 private: | 71 private: |
| 70 SkImage_Raster() : INHERITED(0, 0) {} | 72 SkImage_Raster() : INHERITED(0, 0) {} |
| 71 | 73 |
| 72 SkBitmap fBitmap; | 74 SkBitmap fBitmap; |
| 73 | 75 |
| 74 typedef SkImage_Base INHERITED; | 76 typedef SkImage_Base INHERITED; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 /////////////////////////////////////////////////////////////////////////////// | 79 /////////////////////////////////////////////////////////////////////////////// |
| 78 | 80 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 198 } |
| 197 | 199 |
| 198 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, | 200 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, |
| 199 size_t rowBytes) { | 201 size_t rowBytes) { |
| 200 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes)); | 202 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes)); |
| 201 } | 203 } |
| 202 | 204 |
| 203 SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) { | 205 SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) { |
| 204 return ((SkImage_Raster*)image)->getPixelRef(); | 206 return ((SkImage_Raster*)image)->getPixelRef(); |
| 205 } | 207 } |
| 208 |
| 209 bool SkImage_Raster::isOpaque() const { |
| 210 return fBitmap.isOpaque(); |
| 211 } |
| OLD | NEW |