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 "SkImageGenerator.h" | 10 #include "SkImageGenerator.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 GrTexture* SkImage::getTexture() const { | 58 GrTexture* SkImage::getTexture() const { |
59 return as_IB(this)->onGetTexture(); | 59 return as_IB(this)->onGetTexture(); |
60 } | 60 } |
61 | 61 |
62 SkShader* SkImage::newShader(SkShader::TileMode tileX, | 62 SkShader* SkImage::newShader(SkShader::TileMode tileX, |
63 SkShader::TileMode tileY, | 63 SkShader::TileMode tileY, |
64 const SkMatrix* localMatrix) const { | 64 const SkMatrix* localMatrix) const { |
65 return as_IB(this)->onNewShader(tileX, tileY, localMatrix); | 65 return as_IB(this)->onNewShader(tileX, tileY, localMatrix); |
66 } | 66 } |
67 | 67 |
68 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { | 68 SkData* SkImage::encode(SkEncodedFormat type, int quality) const { |
69 SkBitmap bm; | 69 SkBitmap bm; |
70 if (as_IB(this)->getROPixels(&bm)) { | 70 if (as_IB(this)->getROPixels(&bm)) { |
71 return SkImageEncoder::EncodeData(bm, type, quality); | 71 return SkImageEncoder::EncodeData(bm, type, quality); |
72 } | 72 } |
73 return NULL; | 73 return NULL; |
74 } | 74 } |
75 | 75 |
76 SkImage* SkImage::NewFromData(SkData* data) { | 76 SkImage* SkImage::NewFromData(SkData* data) { |
77 if (NULL == data) { | 77 if (NULL == data) { |
78 return NULL; | 78 return NULL; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 surface->getCanvas()->translate(-src.x(), -src.y()); | 172 surface->getCanvas()->translate(-src.x(), -src.y()); |
173 | 173 |
174 SkPaint paint; | 174 SkPaint paint; |
175 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 175 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
176 paint.setFilterQuality(quality); | 176 paint.setFilterQuality(quality); |
177 surface->getCanvas()->drawImage(this, 0, 0, &paint); | 177 surface->getCanvas()->drawImage(this, 0, 0, &paint); |
178 return surface->newImageSnapshot(); | 178 return surface->newImageSnapshot(); |
179 } | 179 } |
180 | 180 |
181 | 181 |
OLD | NEW |