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

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

Issue 2357273002: Add output format properties to SkImageFilter::Context (Closed)
Patch Set: Spelling Created 4 years, 3 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 | « include/effects/SkXfermodeImageFilter.h ('k') | src/core/SkBlurImageFilter.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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 SkBitmap resultBM; 389 SkBitmap resultBM;
390 390
391 SkImageFilter* filter = paint.getImageFilter(); 391 SkImageFilter* filter = paint.getImageFilter();
392 if (filter) { 392 if (filter) {
393 SkIPoint offset = SkIPoint::Make(0, 0); 393 SkIPoint offset = SkIPoint::Make(0, 0);
394 SkMatrix matrix = *draw.fMatrix; 394 SkMatrix matrix = *draw.fMatrix;
395 matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); 395 matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
396 const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-x, -y); 396 const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-x, -y);
397 SkAutoTUnref<SkImageFilterCache> cache(this->getImageFilterCache()); 397 SkAutoTUnref<SkImageFilterCache> cache(this->getImageFilterCache());
398 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 398 SkImageFilter::OutputProperties outputProperties(fBitmap.colorSpace());
399 SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), outputProper ties);
399 400
400 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg, ctx, &offset )); 401 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg, ctx, &offset ));
401 if (resultImg) { 402 if (resultImg) {
402 SkPaint tmpUnfiltered(paint); 403 SkPaint tmpUnfiltered(paint);
403 tmpUnfiltered.setImageFilter(nullptr); 404 tmpUnfiltered.setImageFilter(nullptr);
404 if (resultImg->getROPixels(&resultBM)) { 405 if (resultImg->getROPixels(&resultBM)) {
405 this->drawSprite(draw, resultBM, x + offset.x(), y + offset.y(), tmpUnfiltered); 406 this->drawSprite(draw, resultBM, x + offset.x(), y + offset.y(), tmpUnfiltered);
406 } 407 }
407 } 408 }
408 } else { 409 } else {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 paint.getRasterizer() || 445 paint.getRasterizer() ||
445 paint.getPathEffect() || 446 paint.getPathEffect() ||
446 paint.isFakeBoldText() || 447 paint.isFakeBoldText() ||
447 paint.getStyle() != SkPaint::kFill_Style || 448 paint.getStyle() != SkPaint::kFill_Style ||
448 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 449 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
449 { 450 {
450 return true; 451 return true;
451 } 452 }
452 return false; 453 return false;
453 } 454 }
OLDNEW
« no previous file with comments | « include/effects/SkXfermodeImageFilter.h ('k') | src/core/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698