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

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

Issue 731373003: change roundOut() to take a dst, so we can use that signature to return IRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « include/core/SkRect.h ('k') | src/ports/SkFontHost_win.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkGpuBlurUtils.h" 8 #include "SkGpuBlurUtils.h"
9 9
10 #include "SkRect.h" 10 #include "SkRect.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 SkIRect clearRect; 156 SkIRect clearRect;
157 int scaleFactorX, radiusX; 157 int scaleFactorX, radiusX;
158 int scaleFactorY, radiusY; 158 int scaleFactorY, radiusY;
159 int maxTextureSize = context->getMaxTextureSize(); 159 int maxTextureSize = context->getMaxTextureSize();
160 sigmaX = adjust_sigma(sigmaX, maxTextureSize, &scaleFactorX, &radiusX); 160 sigmaX = adjust_sigma(sigmaX, maxTextureSize, &scaleFactorX, &radiusX);
161 sigmaY = adjust_sigma(sigmaY, maxTextureSize, &scaleFactorY, &radiusY); 161 sigmaY = adjust_sigma(sigmaY, maxTextureSize, &scaleFactorY, &radiusY);
162 162
163 SkRect srcRect(rect); 163 SkRect srcRect(rect);
164 scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY); 164 scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY);
165 srcRect.roundOut(); 165 srcRect.roundOut(&srcRect);
166 scale_rect(&srcRect, static_cast<float>(scaleFactorX), 166 scale_rect(&srcRect, static_cast<float>(scaleFactorX),
167 static_cast<float>(scaleFactorY)); 167 static_cast<float>(scaleFactorY));
168 168
169 GrContext::AutoClip acs(context, SkRect::MakeWH(srcRect.width(), srcRect.hei ght())); 169 GrContext::AutoClip acs(context, SkRect::MakeWH(srcRect.width(), srcRect.hei ght()));
170 170
171 SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() || 171 SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() ||
172 kRGBA_8888_GrPixelConfig == srcTexture->config() || 172 kRGBA_8888_GrPixelConfig == srcTexture->config() ||
173 kAlpha_8_GrPixelConfig == srcTexture->config()); 173 kAlpha_8_GrPixelConfig == srcTexture->config());
174 174
175 GrSurfaceDesc desc; 175 GrSurfaceDesc desc;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 context->drawRectToRect(paint, dstRect, srcRect); 303 context->drawRectToRect(paint, dstRect, srcRect);
304 srcRect = dstRect; 304 srcRect = dstRect;
305 srcTexture = dstTexture; 305 srcTexture = dstTexture;
306 SkTSwap(dstTexture, tempTexture); 306 SkTSwap(dstTexture, tempTexture);
307 } 307 }
308 return SkRef(srcTexture); 308 return SkRef(srcTexture);
309 } 309 }
310 #endif 310 #endif
311 311
312 } 312 }
OLDNEW
« no previous file with comments | « include/core/SkRect.h ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698