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 { |
| 82 return as_IB(this)->onNewShader(tileX, tileY); |
| 83 } |
| 84 |
81 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { | 85 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { |
82 SkBitmap bm; | 86 SkBitmap bm; |
83 if (as_IB(this)->getROPixels(&bm)) { | 87 if (as_IB(this)->getROPixels(&bm)) { |
84 return SkImageEncoder::EncodeData(bm, type, quality); | 88 return SkImageEncoder::EncodeData(bm, type, quality); |
85 } | 89 } |
86 return NULL; | 90 return NULL; |
87 } | 91 } |
88 | 92 |
89 /////////////////////////////////////////////////////////////////////////////// | 93 /////////////////////////////////////////////////////////////////////////////// |
90 | 94 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 131 |
128 SkCanvas canvas(*bitmap); | 132 SkCanvas canvas(*bitmap); |
129 | 133 |
130 SkPaint paint; | 134 SkPaint paint; |
131 paint.setXfermodeMode(SkXfermode::kClear_Mode); | 135 paint.setXfermodeMode(SkXfermode::kClear_Mode); |
132 canvas.drawRect(dstR, paint); | 136 canvas.drawRect(dstR, paint); |
133 | 137 |
134 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL
); | 138 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL
); |
135 return true; | 139 return true; |
136 } | 140 } |
OLD | NEW |