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

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

Issue 1973563002: Revert of Make SkGpuBlurUtils::GaussianBlur more drawContext centric (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | src/effects/SkBlurMaskFilter.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 2011 The Android Open Source Project 2 * Copyright 2011 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 "SkBlurImageFilter.h" 8 #include "SkBlurImageFilter.h"
9 9
10 #include "SkAutoPixmapStorage.h" 10 #include "SkAutoPixmapStorage.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 offset->fY = inputBounds.y(); 114 offset->fY = inputBounds.y();
115 return input->makeSubset(inputBounds.makeOffset(-inputOffset.x(), 115 return input->makeSubset(inputBounds.makeOffset(-inputOffset.x(),
116 -inputOffset.y())); 116 -inputOffset.y()));
117 } 117 }
118 118
119 offset->fX = dstBounds.fLeft; 119 offset->fX = dstBounds.fLeft;
120 offset->fY = dstBounds.fTop; 120 offset->fY = dstBounds.fTop;
121 inputBounds.offset(-inputOffset); 121 inputBounds.offset(-inputOffset);
122 dstBounds.offset(-inputOffset); 122 dstBounds.offset(-inputOffset);
123 SkRect inputBoundsF(SkRect::Make(inputBounds)); 123 SkRect inputBoundsF(SkRect::Make(inputBounds));
124 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur( 124 sk_sp<GrTexture> tex(SkGpuBlurUtils::GaussianBlur(context,
125 context, 125 inputTexture.get(),
126 inputTexture.g et(), 126 source->props().isGamm aCorrect(),
127 source->props( ).isGammaCorrect(), 127 SkRect::Make(dstBounds ),
128 SkRect::Make(d stBounds), 128 &inputBoundsF,
129 &inputBoundsF, 129 sigma.x(),
130 sigma.x(), 130 sigma.y()));
131 sigma.y())); 131 if (!tex) {
132 if (!drawContext) {
133 return nullptr; 132 return nullptr;
134 } 133 }
135 134
136 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), ds tBounds.height()), 135 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), ds tBounds.height()),
137 kNeedNewImageUniqueID_SpecialImage, 136 kNeedNewImageUniqueID_SpecialImage,
138 drawContext->asTexture(), &source->pr ops()); 137 std::move(tex), &source->props());
139 } 138 }
140 #endif 139 #endif
141 140
142 int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX; 141 int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX;
143 int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY; 142 int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY;
144 get_box3_params(sigma.x(), &kernelSizeX, &kernelSizeX3, &lowOffsetX, &highOf fsetX); 143 get_box3_params(sigma.x(), &kernelSizeX, &kernelSizeX3, &lowOffsetX, &highOf fsetX);
145 get_box3_params(sigma.y(), &kernelSizeY, &kernelSizeY3, &lowOffsetY, &highOf fsetY); 144 get_box3_params(sigma.y(), &kernelSizeY, &kernelSizeY3, &lowOffsetY, &highOf fsetY);
146 145
147 if (kernelSizeX < 0 || kernelSizeY < 0) { 146 if (kernelSizeX < 0 || kernelSizeY < 0) {
148 return nullptr; 147 return nullptr;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 str->appendf("SkBlurImageFilter: ("); 248 str->appendf("SkBlurImageFilter: (");
250 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); 249 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight);
251 250
252 if (this->getInput(0)) { 251 if (this->getInput(0)) {
253 this->getInput(0)->toString(str); 252 this->getInput(0)->toString(str);
254 } 253 }
255 254
256 str->append("))"); 255 str->append("))");
257 } 256 }
258 #endif 257 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698