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

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

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment Created 4 years, 5 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/SkAlphaThresholdFilter.cpp ('k') | 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 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur( 123 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur(
124 context, 124 context,
125 inputTexture.g et(), 125 inputTexture.get (),
126 source->props( ).isGammaCorrect(), 126 sk_ref_sp(source ->getColorSpace()),
127 dstBounds, 127 source->props(). isGammaCorrect(),
128 &inputBounds, 128 dstBounds,
129 sigma.x(), 129 &inputBounds,
130 sigma.y())); 130 sigma.x(),
131 sigma.y()));
131 if (!drawContext) { 132 if (!drawContext) {
132 return nullptr; 133 return nullptr;
133 } 134 }
134 135
135 // TODO: Get the colorSpace from the drawContext (once it has one) 136 // TODO: Get the colorSpace from the drawContext (once it has one)
136 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), ds tBounds.height()), 137 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), ds tBounds.height()),
137 kNeedNewImageUniqueID_SpecialImage, 138 kNeedNewImageUniqueID_SpecialImage,
138 drawContext->asTexture(), 139 drawContext->asTexture(),
139 sk_ref_sp(input->getColorSpace()), &s ource->props()); 140 sk_ref_sp(input->getColorSpace()), &s ource->props());
140 } 141 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 str->appendf("SkBlurImageFilter: ("); 251 str->appendf("SkBlurImageFilter: (");
251 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); 252 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight);
252 253
253 if (this->getInput(0)) { 254 if (this->getInput(0)) {
254 this->getInput(0)->toString(str); 255 this->getInput(0)->toString(str);
255 } 256 }
256 257
257 str->append("))"); 258 str->append("))");
258 } 259 }
259 #endif 260 #endif
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698