OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |