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" | |
15 #include "SkImage_Base.h" | 14 #include "SkImage_Base.h" |
16 #include "SkNextID.h" | 15 #include "SkNextID.h" |
17 #include "SkPixelRef.h" | 16 #include "SkPixelRef.h" |
18 #include "SkPixelSerializer.h" | 17 #include "SkPixelSerializer.h" |
19 #include "SkReadPixelsRec.h" | 18 #include "SkReadPixelsRec.h" |
20 #include "SkString.h" | 19 #include "SkString.h" |
21 #include "SkSurface.h" | 20 #include "SkSurface.h" |
22 | 21 |
23 #if SK_SUPPORT_GPU | 22 #if SK_SUPPORT_GPU |
24 #include "GrTexture.h" | 23 #include "GrTexture.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SkBitmap bm; | 62 SkBitmap bm; |
64 if (as_IB(this)->getROPixels(&bm)) { | 63 if (as_IB(this)->getROPixels(&bm)) { |
65 bm.lockPixels(); | 64 bm.lockPixels(); |
66 bm.unlockPixels(); | 65 bm.unlockPixels(); |
67 } | 66 } |
68 } | 67 } |
69 | 68 |
70 SkShader* SkImage::newShader(SkShader::TileMode tileX, | 69 SkShader* SkImage::newShader(SkShader::TileMode tileX, |
71 SkShader::TileMode tileY, | 70 SkShader::TileMode tileY, |
72 const SkMatrix* localMatrix) const { | 71 const SkMatrix* localMatrix) const { |
73 return SkImageShader::Create(this, tileX, tileY, localMatrix); | 72 return as_IB(this)->onNewShader(tileX, tileY, localMatrix); |
74 } | 73 } |
75 | 74 |
76 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { | 75 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { |
77 SkBitmap bm; | 76 SkBitmap bm; |
78 if (as_IB(this)->getROPixels(&bm)) { | 77 if (as_IB(this)->getROPixels(&bm)) { |
79 return SkImageEncoder::EncodeData(bm, type, quality); | 78 return SkImageEncoder::EncodeData(bm, type, quality); |
80 } | 79 } |
81 return nullptr; | 80 return nullptr; |
82 } | 81 } |
83 | 82 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 365 |
367 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { | 366 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { |
368 return nullptr; | 367 return nullptr; |
369 } | 368 } |
370 | 369 |
371 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 370 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
372 return nullptr; | 371 return nullptr; |
373 } | 372 } |
374 | 373 |
375 #endif | 374 #endif |
OLD | NEW |