| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBitmapCache.h" | 9 #include "SkBitmapCache.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| 11 #include "SkData.h" | 11 #include "SkData.h" |
| 12 #include "SkImageGenerator.h" | 12 #include "SkImageGenerator.h" |
| 13 #include "SkImagePriv.h" | 13 #include "SkImagePriv.h" |
| 14 #include "SkImageShader.h" |
| 14 #include "SkImage_Base.h" | 15 #include "SkImage_Base.h" |
| 15 #include "SkNextID.h" | 16 #include "SkNextID.h" |
| 16 #include "SkPixelRef.h" | 17 #include "SkPixelRef.h" |
| 17 #include "SkPixelSerializer.h" | 18 #include "SkPixelSerializer.h" |
| 18 #include "SkReadPixelsRec.h" | 19 #include "SkReadPixelsRec.h" |
| 19 #include "SkString.h" | 20 #include "SkString.h" |
| 20 #include "SkSurface.h" | 21 #include "SkSurface.h" |
| 21 | 22 |
| 22 #if SK_SUPPORT_GPU | 23 #if SK_SUPPORT_GPU |
| 23 #include "GrTexture.h" | 24 #include "GrTexture.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 SkBitmap bm; | 63 SkBitmap bm; |
| 63 if (as_IB(this)->getROPixels(&bm)) { | 64 if (as_IB(this)->getROPixels(&bm)) { |
| 64 bm.lockPixels(); | 65 bm.lockPixels(); |
| 65 bm.unlockPixels(); | 66 bm.unlockPixels(); |
| 66 } | 67 } |
| 67 } | 68 } |
| 68 | 69 |
| 69 SkShader* SkImage::newShader(SkShader::TileMode tileX, | 70 SkShader* SkImage::newShader(SkShader::TileMode tileX, |
| 70 SkShader::TileMode tileY, | 71 SkShader::TileMode tileY, |
| 71 const SkMatrix* localMatrix) const { | 72 const SkMatrix* localMatrix) const { |
| 72 return as_IB(this)->onNewShader(tileX, tileY, localMatrix); | 73 return SkImageShader::Create(this, tileX, tileY, localMatrix); |
| 73 } | 74 } |
| 74 | 75 |
| 75 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { | 76 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { |
| 76 SkBitmap bm; | 77 SkBitmap bm; |
| 77 if (as_IB(this)->getROPixels(&bm)) { | 78 if (as_IB(this)->getROPixels(&bm)) { |
| 78 return SkImageEncoder::EncodeData(bm, type, quality); | 79 return SkImageEncoder::EncodeData(bm, type, quality); |
| 79 } | 80 } |
| 80 return nullptr; | 81 return nullptr; |
| 81 } | 82 } |
| 82 | 83 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 325 |
| 325 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { | 326 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { |
| 326 return nullptr; | 327 return nullptr; |
| 327 } | 328 } |
| 328 | 329 |
| 329 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 330 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
| 330 return nullptr; | 331 return nullptr; |
| 331 } | 332 } |
| 332 | 333 |
| 333 #endif | 334 #endif |
| OLD | NEW |