| 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" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkData.h" | 12 #include "SkData.h" |
| 13 #include "SkDecodingImageGenerator.h" | 13 #include "SkImageGenerator.h" |
| 14 #include "SkSurface.h" | 14 #include "SkSurface.h" |
| 15 | 15 |
| 16 class SkImage_Raster : public SkImage_Base { | 16 class SkImage_Raster : public SkImage_Base { |
| 17 public: | 17 public: |
| 18 static bool ValidArgs(const Info& info, size_t rowBytes) { | 18 static bool ValidArgs(const Info& info, size_t rowBytes) { |
| 19 const int maxDimension = SK_MaxS32 >> 2; | 19 const int maxDimension = SK_MaxS32 >> 2; |
| 20 const size_t kMaxPixelByteSize = SK_MaxS32; | 20 const size_t kMaxPixelByteSize = SK_MaxS32; |
| 21 | 21 |
| 22 if (info.width() <= 0 || info.height() <= 0) { | 22 if (info.width() <= 0 || info.height() <= 0) { |
| 23 return false; | 23 return false; |
| (...skipping 170 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 |