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

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

Issue 1543323002: remove dead flags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 12 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/core/SkCanvas.cpp ('k') | no next file » | 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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkOffsetImageFilter.h" 8 #include "SkOffsetImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkDevice.h" 11 #include "SkDevice.h"
12 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 #include "SkMatrix.h" 14 #include "SkMatrix.h"
15 #include "SkPaint.h" 15 #include "SkPaint.h"
16 16
17 bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, 17 bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
18 const Context& ctx, 18 const Context& ctx,
19 SkBitmap* result, 19 SkBitmap* result,
20 SkIPoint* offset) const { 20 SkIPoint* offset) const {
21 SkBitmap src = source; 21 SkBitmap src = source;
22 SkIPoint srcOffset = SkIPoint::Make(0, 0); 22 SkIPoint srcOffset = SkIPoint::Make(0, 0);
23 #ifdef SK_DISABLE_OFFSETIMAGEFILTER_OPTIMIZATION
24 if (false) {
25 #else
26 if (!cropRectIsSet()) { 23 if (!cropRectIsSet()) {
27 #endif
28 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) { 24 if (!this->filterInput(0, proxy, source, ctx, &src, &srcOffset)) {
29 return false; 25 return false;
30 } 26 }
31 27
32 SkVector vec; 28 SkVector vec;
33 ctx.ctm().mapVectors(&vec, &fOffset, 1); 29 ctx.ctm().mapVectors(&vec, &fOffset, 1);
34 30
35 offset->fX = srcOffset.fX + SkScalarRoundToInt(vec.fX); 31 offset->fX = srcOffset.fX + SkScalarRoundToInt(vec.fX);
36 offset->fY = srcOffset.fY + SkScalarRoundToInt(vec.fY); 32 offset->fY = srcOffset.fY + SkScalarRoundToInt(vec.fY);
37 *result = src; 33 *result = src;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void SkOffsetImageFilter::toString(SkString* str) const { 112 void SkOffsetImageFilter::toString(SkString* str) const {
117 str->appendf("SkOffsetImageFilter: ("); 113 str->appendf("SkOffsetImageFilter: (");
118 str->appendf("offset: (%f, %f) ", fOffset.fX, fOffset.fY); 114 str->appendf("offset: (%f, %f) ", fOffset.fX, fOffset.fY);
119 str->append("input: ("); 115 str->append("input: (");
120 if (this->getInput(0)) { 116 if (this->getInput(0)) {
121 this->getInput(0)->toString(str); 117 this->getInput(0)->toString(str);
122 } 118 }
123 str->append("))"); 119 str->append("))");
124 } 120 }
125 #endif 121 #endif
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698