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" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 int srcX, int srcY, CachingHint) const { | 252 int srcX, int srcY, CachingHint) const { |
253 if (!raster_canvas_supports(dstInfo)) { | 253 if (!raster_canvas_supports(dstInfo)) { |
254 return false; | 254 return false; |
255 } | 255 } |
256 | 256 |
257 SkBitmap bm; | 257 SkBitmap bm; |
258 bm.installPixels(dstInfo, dstPixels, dstRowBytes); | 258 bm.installPixels(dstInfo, dstPixels, dstRowBytes); |
259 SkCanvas canvas(bm); | 259 SkCanvas canvas(bm); |
260 | 260 |
261 SkPaint paint; | 261 SkPaint paint; |
262 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 262 paint.setBlendMode(SkBlendMode::kSrc); |
263 canvas.drawImage(this, -SkIntToScalar(srcX), -SkIntToScalar(srcY), &paint); | 263 canvas.drawImage(this, -SkIntToScalar(srcX), -SkIntToScalar(srcY), &paint); |
264 | 264 |
265 return true; | 265 return true; |
266 } | 266 } |
267 | 267 |
268 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 268 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
269 | 269 |
270 bool SkImage::readPixels(const SkPixmap& pmap, int srcX, int srcY, CachingHint c
hint) const { | 270 bool SkImage::readPixels(const SkPixmap& pmap, int srcX, int srcY, CachingHint c
hint) const { |
271 return this->readPixels(pmap.info(), pmap.writable_addr(), pmap.rowBytes(),
srcX, srcY, chint); | 271 return this->readPixels(pmap.info(), pmap.writable_addr(), pmap.rowBytes(),
srcX, srcY, chint); |
272 } | 272 } |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 SkASSERT(image); | 515 SkASSERT(image); |
516 SkASSERT(ctx); | 516 SkASSERT(ctx); |
517 as_IB(image)->onPinAsTexture(ctx); | 517 as_IB(image)->onPinAsTexture(ctx); |
518 } | 518 } |
519 | 519 |
520 void SkImage_unpinAsTexture(const SkImage* image, GrContext* ctx) { | 520 void SkImage_unpinAsTexture(const SkImage* image, GrContext* ctx) { |
521 SkASSERT(image); | 521 SkASSERT(image); |
522 SkASSERT(ctx); | 522 SkASSERT(ctx); |
523 as_IB(image)->onUnpinAsTexture(ctx); | 523 as_IB(image)->onUnpinAsTexture(ctx); |
524 } | 524 } |
OLD | NEW |