Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: src/image/SkImage.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/text/GrTextUtils.cpp ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrTextUtils.cpp ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698