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

Side by Side Diff: src/effects/SkPaintImageFilter.cpp

Issue 1702683002: Image filters: change applyCropRect() to take a src rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/effects/SkOffsetImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.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 2016 Google Inc. 2 * Copyright 2016 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 "SkPaintImageFilter.h" 8 #include "SkPaintImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 21 matching lines...) Expand all
32 this->INHERITED::flatten(buffer); 32 this->INHERITED::flatten(buffer);
33 buffer.writePaint(fPaint); 33 buffer.writePaint(fPaint);
34 } 34 }
35 35
36 bool SkPaintImageFilter::onFilterImage(Proxy* proxy, 36 bool SkPaintImageFilter::onFilterImage(Proxy* proxy,
37 const SkBitmap& source, 37 const SkBitmap& source,
38 const Context& ctx, 38 const Context& ctx,
39 SkBitmap* result, 39 SkBitmap* result,
40 SkIPoint* offset) const { 40 SkIPoint* offset) const {
41 SkIRect bounds; 41 SkIRect bounds;
42 if (!this->applyCropRect(ctx, source, SkIPoint::Make(0, 0), &bounds)) { 42 if (!this->applyCropRect(ctx, source.bounds(), &bounds)) {
43 return false; 43 return false;
44 } 44 }
45 45
46 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), 46 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(),
47 bounds.height())); 47 bounds.height()));
48 if (nullptr == device.get()) { 48 if (nullptr == device.get()) {
49 return false; 49 return false;
50 } 50 }
51 SkCanvas canvas(device.get()); 51 SkCanvas canvas(device.get());
52 52
(...skipping 19 matching lines...) Expand all
72 // so we can't compute it. If a full crop rect is set, we should return true here. 72 // so we can't compute it. If a full crop rect is set, we should return true here.
73 return false; 73 return false;
74 } 74 }
75 75
76 #ifndef SK_IGNORE_TO_STRING 76 #ifndef SK_IGNORE_TO_STRING
77 void SkPaintImageFilter::toString(SkString* str) const { 77 void SkPaintImageFilter::toString(SkString* str) const {
78 str->appendf("SkPaintImageFilter: ("); 78 str->appendf("SkPaintImageFilter: (");
79 str->append(")"); 79 str->append(")");
80 } 80 }
81 #endif 81 #endif
OLDNEW
« no previous file with comments | « src/effects/SkOffsetImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698