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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 1154293002: don't use accessBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/core/SkBitmapDevice.cpp ('k') | src/image/SkSurface_Gpu.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ()); 1252 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ());
1253 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ()); 1253 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ());
1254 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 1254 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1255 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { 1255 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
1256 SkPaint tmpUnfiltered(*paint); 1256 SkPaint tmpUnfiltered(*paint);
1257 tmpUnfiltered.setImageFilter(NULL); 1257 tmpUnfiltered.setImageFilter(NULL);
1258 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of fset.y(), 1258 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of fset.y(),
1259 tmpUnfiltered); 1259 tmpUnfiltered);
1260 } 1260 }
1261 } else if (deviceIsBitmapDevice) { 1261 } else if (deviceIsBitmapDevice) {
1262 const SkBitmap& src = srcDev->accessBitmap(false); 1262 const SkBitmap& src = static_cast<SkBitmapDevice*>(srcDev)->fBitmap;
1263 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); 1263 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint);
1264 } else { 1264 } else {
1265 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); 1265 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint);
1266 } 1266 }
1267 } 1267 }
1268 LOOPER_END 1268 LOOPER_END
1269 } 1269 }
1270 1270
1271 void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) { 1271 void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) {
1272 if (gTreatSpriteAsBitmap) { 1272 if (gTreatSpriteAsBitmap) {
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 } 2709 }
2710 2710
2711 if (matrix) { 2711 if (matrix) {
2712 canvas->concat(*matrix); 2712 canvas->concat(*matrix);
2713 } 2713 }
2714 } 2714 }
2715 2715
2716 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2716 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2717 fCanvas->restoreToCount(fSaveCount); 2717 fCanvas->restoreToCount(fSaveCount);
2718 } 2718 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698