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

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

Issue 1842793002: Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ooops Created 4 years, 8 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 | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkImageFilter.cpp » ('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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 1154
1155 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(), &srcBM); 1155 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(), &srcBM);
1156 } else 1156 } else
1157 #endif 1157 #endif
1158 { 1158 {
1159 srcBM = src->accessBitmap(false); 1159 srcBM = src->accessBitmap(false);
1160 } 1160 }
1161 1161
1162 SkCanvas c(dst); 1162 SkCanvas c(dst);
1163 1163
1164 SkAutoTUnref<SkImageFilter> localF(filter->newWithLocalMatrix(ctm));
1165 SkPaint p; 1164 SkPaint p;
1166 p.setImageFilter(localF); 1165 p.setImageFilter(filter->makeWithLocalMatrix(ctm));
1167 const SkScalar x = SkIntToScalar(src->getOrigin().x()); 1166 const SkScalar x = SkIntToScalar(src->getOrigin().x());
1168 const SkScalar y = SkIntToScalar(src->getOrigin().y()); 1167 const SkScalar y = SkIntToScalar(src->getOrigin().y());
1169 c.drawBitmap(srcBM, x, y, &p); 1168 c.drawBitmap(srcBM, x, y, &p);
1170 } 1169 }
1171 1170
1172 static SkImageInfo make_layer_info(const SkImageInfo& prev, int w, int h, bool i sOpaque, 1171 static SkImageInfo make_layer_info(const SkImageInfo& prev, int w, int h, bool i sOpaque,
1173 const SkPaint* paint) { 1172 const SkPaint* paint) {
1174 // need to force L32 for now if we have an image filter. Once filters suppor t other colortypes 1173 // need to force L32 for now if we have an image filter. Once filters suppor t other colortypes
1175 // e.g. sRGB or F16, we can remove this check 1174 // e.g. sRGB or F16, we can remove this check
1176 const bool hasImageFilter = paint && paint->getImageFilter(); 1175 const bool hasImageFilter = paint && paint->getImageFilter();
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 3040
3042 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3041 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3043 fCanvas->restoreToCount(fSaveCount); 3042 fCanvas->restoreToCount(fSaveCount);
3044 } 3043 }
3045 3044
3046 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3045 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3047 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3046 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3048 return this->makeSurface(info, props).release(); 3047 return this->makeSurface(info, props).release();
3049 } 3048 }
3050 #endif 3049 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698