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

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

Issue 171723007: add new copyTo version to SkBitmap, which takes SkColorType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/gpu/SkGr.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX; 171 int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX;
172 int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY; 172 int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY;
173 getBox3Params(sigma.x(), &kernelSizeX, &kernelSizeX3, &lowOffsetX, &highOffs etX); 173 getBox3Params(sigma.x(), &kernelSizeX, &kernelSizeX3, &lowOffsetX, &highOffs etX);
174 getBox3Params(sigma.y(), &kernelSizeY, &kernelSizeY3, &lowOffsetY, &highOffs etY); 174 getBox3Params(sigma.y(), &kernelSizeY, &kernelSizeY3, &lowOffsetY, &highOffs etY);
175 175
176 if (kernelSizeX < 0 || kernelSizeY < 0) { 176 if (kernelSizeX < 0 || kernelSizeY < 0) {
177 return false; 177 return false;
178 } 178 }
179 179
180 if (kernelSizeX == 0 && kernelSizeY == 0) { 180 if (kernelSizeX == 0 && kernelSizeY == 0) {
181 src.copyTo(dst, dst->config()); 181 src.copyTo(dst, dst->colorType());
182 offset->fX = srcBounds.fLeft; 182 offset->fX = srcBounds.fLeft;
183 offset->fY = srcBounds.fTop; 183 offset->fY = srcBounds.fTop;
184 return true; 184 return true;
185 } 185 }
186 186
187 SkBitmap temp; 187 SkBitmap temp;
188 temp.setConfig(dst->config(), dst->width(), dst->height()); 188 temp.setConfig(dst->config(), dst->width(), dst->height());
189 if (!temp.allocPixels()) { 189 if (!temp.allocPixels()) {
190 return false; 190 return false;
191 } 191 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 SkRect::Make(rect), 277 SkRect::Make(rect),
278 true, 278 true,
279 sigma.x(), 279 sigma.x(),
280 sigma.y())); 280 sigma.y()));
281 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res ult); 281 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res ult);
282 #else 282 #else
283 SkDEBUGFAIL("Should not call in GPU-less build"); 283 SkDEBUGFAIL("Should not call in GPU-less build");
284 return false; 284 return false;
285 #endif 285 #endif
286 } 286 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698