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

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: surface props plumbing 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
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 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 paint = &tmp; 1207 paint = &tmp;
1208 } 1208 }
1209 1209
1210 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) 1210 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type)
1211 while (iter.next()) { 1211 while (iter.next()) {
1212 SkBaseDevice* dstDev = iter.fDevice; 1212 SkBaseDevice* dstDev = iter.fDevice;
1213 paint = &looper.paint(); 1213 paint = &looper.paint();
1214 SkImageFilter* filter = paint->getImageFilter(); 1214 SkImageFilter* filter = paint->getImageFilter();
1215 SkIPoint pos = { x - iter.getX(), y - iter.getY() }; 1215 SkIPoint pos = { x - iter.getX(), y - iter.getY() };
1216 if (filter && !dstDev->canHandleImageFilter(filter)) { 1216 if (filter && !dstDev->canHandleImageFilter(filter)) {
1217 SkDeviceImageFilterProxy proxy(dstDev); 1217 SkDeviceImageFilterProxy proxy(dstDev, fProps);
1218 SkBitmap dst; 1218 SkBitmap dst;
1219 SkIPoint offset = SkIPoint::Make(0, 0); 1219 SkIPoint offset = SkIPoint::Make(0, 0);
1220 const SkBitmap& src = srcDev->accessBitmap(false); 1220 const SkBitmap& src = srcDev->accessBitmap(false);
1221 SkMatrix matrix = *iter.fMatrix; 1221 SkMatrix matrix = *iter.fMatrix;
1222 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() )); 1222 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() ));
1223 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ()); 1223 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ());
1224 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ()); 1224 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ());
1225 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 1225 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1226 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { 1226 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
1227 SkPaint tmpUnfiltered(*paint); 1227 SkPaint tmpUnfiltered(*paint);
(...skipping 21 matching lines...) Expand all
1249 paint = &tmp; 1249 paint = &tmp;
1250 } 1250 }
1251 1251
1252 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) 1252 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type)
1253 1253
1254 while (iter.next()) { 1254 while (iter.next()) {
1255 paint = &looper.paint(); 1255 paint = &looper.paint();
1256 SkImageFilter* filter = paint->getImageFilter(); 1256 SkImageFilter* filter = paint->getImageFilter();
1257 SkIPoint pos = { x - iter.getX(), y - iter.getY() }; 1257 SkIPoint pos = { x - iter.getX(), y - iter.getY() };
1258 if (filter && !iter.fDevice->canHandleImageFilter(filter)) { 1258 if (filter && !iter.fDevice->canHandleImageFilter(filter)) {
1259 SkDeviceImageFilterProxy proxy(iter.fDevice); 1259 SkDeviceImageFilterProxy proxy(iter.fDevice, fProps);
1260 SkBitmap dst; 1260 SkBitmap dst;
1261 SkIPoint offset = SkIPoint::Make(0, 0); 1261 SkIPoint offset = SkIPoint::Make(0, 0);
1262 SkMatrix matrix = *iter.fMatrix; 1262 SkMatrix matrix = *iter.fMatrix;
1263 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() )); 1263 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() ));
1264 const SkIRect clipBounds = bitmap.bounds(); 1264 const SkIRect clipBounds = bitmap.bounds();
1265 SkAutoTUnref<SkImageFilter::Cache> cache(iter.fDevice->getImageFilte rCache()); 1265 SkAutoTUnref<SkImageFilter::Cache> cache(iter.fDevice->getImageFilte rCache());
1266 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 1266 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1267 if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) { 1267 if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) {
1268 SkPaint tmpUnfiltered(*paint); 1268 SkPaint tmpUnfiltered(*paint);
1269 tmpUnfiltered.setImageFilter(NULL); 1269 tmpUnfiltered.setImageFilter(NULL);
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 } 2579 }
2580 2580
2581 if (matrix) { 2581 if (matrix) {
2582 canvas->concat(*matrix); 2582 canvas->concat(*matrix);
2583 } 2583 }
2584 } 2584 }
2585 2585
2586 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2586 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2587 fCanvas->restoreToCount(fSaveCount); 2587 fCanvas->restoreToCount(fSaveCount);
2588 } 2588 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698