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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 srcRect.roundOut(); | 165 srcRect.roundOut(); |
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 GrTextureDesc desc; | 175 GrSurfaceDesc desc; |
176 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; | 176 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; |
177 desc.fWidth = SkScalarFloorToInt(srcRect.width()); | 177 desc.fWidth = SkScalarFloorToInt(srcRect.width()); |
178 desc.fHeight = SkScalarFloorToInt(srcRect.height()); | 178 desc.fHeight = SkScalarFloorToInt(srcRect.height()); |
179 desc.fConfig = srcTexture->config(); | 179 desc.fConfig = srcTexture->config(); |
180 | 180 |
181 GrTexture* dstTexture; | 181 GrTexture* dstTexture; |
182 GrTexture* tempTexture; | 182 GrTexture* tempTexture; |
183 SkAutoTUnref<GrTexture> temp1, temp2; | 183 SkAutoTUnref<GrTexture> temp1, temp2; |
184 | 184 |
185 temp1.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMa
tch)); | 185 temp1.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMa
tch)); |
186 dstTexture = temp1.get(); | 186 dstTexture = temp1.get(); |
(...skipping 116 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 |