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 "SkImagePriv.h" | 10 #include "SkImagePriv.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // perhaps we could return true + empty-bitmap? | 71 // perhaps we could return true + empty-bitmap? |
72 return false; | 72 return false; |
73 } | 73 } |
74 return as_IB(this)->onReadPixels(bitmap, bounds); | 74 return as_IB(this)->onReadPixels(bitmap, bounds); |
75 } | 75 } |
76 | 76 |
77 GrTexture* SkImage::getTexture() { | 77 GrTexture* SkImage::getTexture() { |
78 return as_IB(this)->onGetTexture(); | 78 return as_IB(this)->onGetTexture(); |
79 } | 79 } |
80 | 80 |
81 SkShader* SkImage::newShader(SkShader::TileMode tileX, SkShader::TileMode tileY)
const { | 81 SkShader* SkImage::newShader(SkShader::TileMode tileX, |
82 return as_IB(this)->onNewShader(tileX, tileY); | 82 SkShader::TileMode tileY, |
| 83 const SkMatrix* localMatrix) const { |
| 84 return as_IB(this)->onNewShader(tileX, tileY, localMatrix); |
83 } | 85 } |
84 | 86 |
85 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { | 87 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { |
86 SkBitmap bm; | 88 SkBitmap bm; |
87 if (as_IB(this)->getROPixels(&bm)) { | 89 if (as_IB(this)->getROPixels(&bm)) { |
88 return SkImageEncoder::EncodeData(bm, type, quality); | 90 return SkImageEncoder::EncodeData(bm, type, quality); |
89 } | 91 } |
90 return NULL; | 92 return NULL; |
91 } | 93 } |
92 | 94 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 133 |
132 SkCanvas canvas(*bitmap); | 134 SkCanvas canvas(*bitmap); |
133 | 135 |
134 SkPaint paint; | 136 SkPaint paint; |
135 paint.setXfermodeMode(SkXfermode::kClear_Mode); | 137 paint.setXfermodeMode(SkXfermode::kClear_Mode); |
136 canvas.drawRect(dstR, paint); | 138 canvas.drawRect(dstR, paint); |
137 | 139 |
138 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL
); | 140 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL
); |
139 return true; | 141 return true; |
140 } | 142 } |
OLD | NEW |