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

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

Issue 725243004: Disable LCD text explicitly in SkPictureImageFilter::onFilterImage() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 6 years, 1 month 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 | « include/core/SkImageFilter.h ('k') | src/core/SkDeviceImageFilterProxy.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 "SkCanvasDrawable.h" 9 #include "SkCanvasDrawable.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 paint = &tmp; 1212 paint = &tmp;
1213 } 1213 }
1214 1214
1215 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) 1215 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type)
1216 while (iter.next()) { 1216 while (iter.next()) {
1217 SkBaseDevice* dstDev = iter.fDevice; 1217 SkBaseDevice* dstDev = iter.fDevice;
1218 paint = &looper.paint(); 1218 paint = &looper.paint();
1219 SkImageFilter* filter = paint->getImageFilter(); 1219 SkImageFilter* filter = paint->getImageFilter();
1220 SkIPoint pos = { x - iter.getX(), y - iter.getY() }; 1220 SkIPoint pos = { x - iter.getX(), y - iter.getY() };
1221 if (filter && !dstDev->canHandleImageFilter(filter)) { 1221 if (filter && !dstDev->canHandleImageFilter(filter)) {
1222 SkDeviceImageFilterProxy proxy(dstDev); 1222 SkDeviceImageFilterProxy proxy(dstDev, fProps);
1223 SkBitmap dst; 1223 SkBitmap dst;
1224 SkIPoint offset = SkIPoint::Make(0, 0); 1224 SkIPoint offset = SkIPoint::Make(0, 0);
1225 const SkBitmap& src = srcDev->accessBitmap(false); 1225 const SkBitmap& src = srcDev->accessBitmap(false);
1226 SkMatrix matrix = *iter.fMatrix; 1226 SkMatrix matrix = *iter.fMatrix;
1227 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() )); 1227 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() ));
1228 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ()); 1228 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ());
1229 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ()); 1229 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ());
1230 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 1230 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1231 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { 1231 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
1232 SkPaint tmpUnfiltered(*paint); 1232 SkPaint tmpUnfiltered(*paint);
(...skipping 21 matching lines...) Expand all
1254 paint = &tmp; 1254 paint = &tmp;
1255 } 1255 }
1256 1256
1257 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) 1257 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type)
1258 1258
1259 while (iter.next()) { 1259 while (iter.next()) {
1260 paint = &looper.paint(); 1260 paint = &looper.paint();
1261 SkImageFilter* filter = paint->getImageFilter(); 1261 SkImageFilter* filter = paint->getImageFilter();
1262 SkIPoint pos = { x - iter.getX(), y - iter.getY() }; 1262 SkIPoint pos = { x - iter.getX(), y - iter.getY() };
1263 if (filter && !iter.fDevice->canHandleImageFilter(filter)) { 1263 if (filter && !iter.fDevice->canHandleImageFilter(filter)) {
1264 SkDeviceImageFilterProxy proxy(iter.fDevice); 1264 SkDeviceImageFilterProxy proxy(iter.fDevice, fProps);
1265 SkBitmap dst; 1265 SkBitmap dst;
1266 SkIPoint offset = SkIPoint::Make(0, 0); 1266 SkIPoint offset = SkIPoint::Make(0, 0);
1267 SkMatrix matrix = *iter.fMatrix; 1267 SkMatrix matrix = *iter.fMatrix;
1268 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() )); 1268 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() ));
1269 const SkIRect clipBounds = bitmap.bounds(); 1269 const SkIRect clipBounds = bitmap.bounds();
1270 SkAutoTUnref<SkImageFilter::Cache> cache(iter.fDevice->getImageFilte rCache()); 1270 SkAutoTUnref<SkImageFilter::Cache> cache(iter.fDevice->getImageFilte rCache());
1271 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 1271 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1272 if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) { 1272 if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) {
1273 SkPaint tmpUnfiltered(*paint); 1273 SkPaint tmpUnfiltered(*paint);
1274 tmpUnfiltered.setImageFilter(NULL); 1274 tmpUnfiltered.setImageFilter(NULL);
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 } 2584 }
2585 2585
2586 if (matrix) { 2586 if (matrix) {
2587 canvas->concat(*matrix); 2587 canvas->concat(*matrix);
2588 } 2588 }
2589 } 2589 }
2590 2590
2591 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2591 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2592 fCanvas->restoreToCount(fSaveCount); 2592 fCanvas->restoreToCount(fSaveCount);
2593 } 2593 }
OLDNEW
« no previous file with comments | « include/core/SkImageFilter.h ('k') | src/core/SkDeviceImageFilterProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698