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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY); | 191 scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY); |
192 srcRect.roundOut(&srcRect); | 192 srcRect.roundOut(&srcRect); |
193 scale_rect(&srcRect, static_cast<float>(scaleFactorX), | 193 scale_rect(&srcRect, static_cast<float>(scaleFactorX), |
194 static_cast<float>(scaleFactorY)); | 194 static_cast<float>(scaleFactorY)); |
195 | 195 |
196 // setup new clip | 196 // setup new clip |
197 GrClip clip(localDstBounds); | 197 GrClip clip(localDstBounds); |
198 | 198 |
199 SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() || | 199 SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() || |
200 kRGBA_8888_GrPixelConfig == srcTexture->config() || | 200 kRGBA_8888_GrPixelConfig == srcTexture->config() || |
| 201 kSRGBA_8888_GrPixelConfig == srcTexture->config() || |
| 202 kSBGRA_8888_GrPixelConfig == srcTexture->config() || |
201 kAlpha_8_GrPixelConfig == srcTexture->config()); | 203 kAlpha_8_GrPixelConfig == srcTexture->config()); |
202 | 204 |
203 GrSurfaceDesc desc; | 205 GrSurfaceDesc desc; |
204 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 206 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
205 desc.fWidth = SkScalarFloorToInt(dstBounds.width()); | 207 desc.fWidth = SkScalarFloorToInt(dstBounds.width()); |
206 desc.fHeight = SkScalarFloorToInt(dstBounds.height()); | 208 desc.fHeight = SkScalarFloorToInt(dstBounds.height()); |
207 desc.fConfig = srcTexture->config(); | 209 desc.fConfig = srcTexture->config(); |
208 | 210 |
209 GrTexture* dstTexture; | 211 GrTexture* dstTexture; |
210 GrTexture* tempTexture; | 212 GrTexture* tempTexture; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 srcRect = dstRect; | 394 srcRect = dstRect; |
393 srcTexture = dstTexture; | 395 srcTexture = dstTexture; |
394 SkTSwap(dstTexture, tempTexture); | 396 SkTSwap(dstTexture, tempTexture); |
395 } | 397 } |
396 | 398 |
397 return SkRef(srcTexture); | 399 return SkRef(srcTexture); |
398 } | 400 } |
399 #endif | 401 #endif |
400 | 402 |
401 } | 403 } |
OLD | NEW |