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