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

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

Issue 1164443002: Revert of Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/gpu/GrAddPathRenderers_default.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"
11 11
12 #if SK_SUPPORT_GPU 12 #if SK_SUPPORT_GPU
13 #include "effects/GrConvolutionEffect.h" 13 #include "effects/GrConvolutionEffect.h"
14 #include "effects/GrMatrixConvolutionEffect.h" 14 #include "effects/GrMatrixConvolutionEffect.h"
15 #include "GrContext.h" 15 #include "GrContext.h"
16 #include "GrCaps.h"
17 #include "GrDrawContext.h" 16 #include "GrDrawContext.h"
18 #endif 17 #endif
19 18
20 namespace SkGpuBlurUtils { 19 namespace SkGpuBlurUtils {
21 20
22 #if SK_SUPPORT_GPU 21 #if SK_SUPPORT_GPU
23 22
24 #define MAX_BLUR_SIGMA 4.0f 23 #define MAX_BLUR_SIGMA 4.0f
25 24
26 static void scale_rect(SkRect* rect, float xScale, float yScale) { 25 static void scale_rect(SkRect* rect, float xScale, float yScale) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 bool canClobberSrc, 147 bool canClobberSrc,
149 const SkRect& rect, 148 const SkRect& rect,
150 bool cropToRect, 149 bool cropToRect,
151 float sigmaX, 150 float sigmaX,
152 float sigmaY) { 151 float sigmaY) {
153 SkASSERT(context); 152 SkASSERT(context);
154 153
155 SkIRect clearRect; 154 SkIRect clearRect;
156 int scaleFactorX, radiusX; 155 int scaleFactorX, radiusX;
157 int scaleFactorY, radiusY; 156 int scaleFactorY, radiusY;
158 int maxTextureSize = context->caps()->maxTextureSize(); 157 int maxTextureSize = context->getMaxTextureSize();
159 sigmaX = adjust_sigma(sigmaX, maxTextureSize, &scaleFactorX, &radiusX); 158 sigmaX = adjust_sigma(sigmaX, maxTextureSize, &scaleFactorX, &radiusX);
160 sigmaY = adjust_sigma(sigmaY, maxTextureSize, &scaleFactorY, &radiusY); 159 sigmaY = adjust_sigma(sigmaY, maxTextureSize, &scaleFactorY, &radiusY);
161 160
162 SkRect srcRect(rect); 161 SkRect srcRect(rect);
163 scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY); 162 scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY);
164 srcRect.roundOut(&srcRect); 163 srcRect.roundOut(&srcRect);
165 scale_rect(&srcRect, static_cast<float>(scaleFactorX), 164 scale_rect(&srcRect, static_cast<float>(scaleFactorX),
166 static_cast<float>(scaleFactorY)); 165 static_cast<float>(scaleFactorY));
167 166
168 // setup new clip 167 // setup new clip
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 SkMatrix::I(), dstRect, srcRect); 307 SkMatrix::I(), dstRect, srcRect);
309 srcRect = dstRect; 308 srcRect = dstRect;
310 srcTexture = dstTexture; 309 srcTexture = dstTexture;
311 SkTSwap(dstTexture, tempTexture); 310 SkTSwap(dstTexture, tempTexture);
312 } 311 }
313 return SkRef(srcTexture); 312 return SkRef(srcTexture);
314 } 313 }
315 #endif 314 #endif
316 315
317 } 316 }
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/gpu/GrAddPathRenderers_default.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698