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

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

Issue 1420053009: Revert of Revert[2] of "stop using drawSprite (at least w/ no filters) as it is going away" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « samplecode/SampleAll.cpp ('k') | src/effects/SkMergeImageFilter.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 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 "SkColorFilterImageFilter.h" 8 #include "SkColorFilterImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height())); 73 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height()));
74 if (nullptr == device.get()) { 74 if (nullptr == device.get()) {
75 return false; 75 return false;
76 } 76 }
77 SkCanvas canvas(device.get()); 77 SkCanvas canvas(device.get());
78 SkPaint paint; 78 SkPaint paint;
79 79
80 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 80 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
81 paint.setColorFilter(fColorFilter); 81 paint.setColorFilter(fColorFilter);
82 canvas.drawBitmap(src, SkIntToScalar(srcOffset.fX - bounds.fLeft), 82 canvas.drawSprite(src, srcOffset.fX - bounds.fLeft, srcOffset.fY - bounds.fT op, &paint);
83 SkIntToScalar(srcOffset.fY - bounds.fTop), &paint);
84 83
85 *result = device.get()->accessBitmap(false); 84 *result = device.get()->accessBitmap(false);
86 offset->fX = bounds.fLeft; 85 offset->fX = bounds.fLeft;
87 offset->fY = bounds.fTop; 86 offset->fY = bounds.fTop;
88 return true; 87 return true;
89 } 88 }
90 89
91 bool SkColorFilterImageFilter::onIsColorFilterNode(SkColorFilter** filter) const { 90 bool SkColorFilterImageFilter::onIsColorFilterNode(SkColorFilter** filter) const {
92 SkASSERT(1 == this->countInputs()); 91 SkASSERT(1 == this->countInputs());
93 if (!this->cropRectIsSet()) { 92 if (!this->cropRectIsSet()) {
(...skipping 18 matching lines...) Expand all
112 if (this->getInput(0)) { 111 if (this->getInput(0)) {
113 this->getInput(0)->toString(str); 112 this->getInput(0)->toString(str);
114 } 113 }
115 114
116 str->appendf(") color filter: "); 115 str->appendf(") color filter: ");
117 fColorFilter->toString(str); 116 fColorFilter->toString(str);
118 117
119 str->append(")"); 118 str->append(")");
120 } 119 }
121 #endif 120 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleAll.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698