OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrCircleBlurFragmentProcessor.h" | 8 #include "GrCircleBlurFragmentProcessor.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
11 | 11 |
12 #include "GrContext.h" | 12 #include "GrContext.h" |
13 #include "GrInvariantOutput.h" | 13 #include "GrInvariantOutput.h" |
14 #include "GrTextureProvider.h" | 14 #include "GrTextureProvider.h" |
15 | 15 |
16 #include "glsl/GrGLSLFragmentProcessor.h" | 16 #include "glsl/GrGLSLFragmentProcessor.h" |
17 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 17 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
18 #include "glsl/GrGLSLProgramDataManager.h" | 18 #include "glsl/GrGLSLProgramDataManager.h" |
19 #include "glsl/GrGLSLUniformHandler.h" | 19 #include "glsl/GrGLSLUniformHandler.h" |
20 | 20 |
| 21 #include "SkFixed.h" |
| 22 |
21 class GrGLCircleBlurFragmentProcessor : public GrGLSLFragmentProcessor { | 23 class GrGLCircleBlurFragmentProcessor : public GrGLSLFragmentProcessor { |
22 public: | 24 public: |
23 void emitCode(EmitArgs&) override; | 25 void emitCode(EmitArgs&) override; |
24 | 26 |
25 protected: | 27 protected: |
26 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; | 28 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; |
27 | 29 |
28 private: | 30 private: |
29 GrGLSLProgramDataManager::UniformHandle fDataUniform; | 31 GrGLSLProgramDataManager::UniformHandle fDataUniform; |
30 | 32 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); | 260 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); |
259 | 261 |
260 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor
TestData* d) { | 262 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor
TestData* d) { |
261 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); | 263 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); |
262 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); | 264 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); |
263 SkRect circle = SkRect::MakeWH(wh, wh); | 265 SkRect circle = SkRect::MakeWH(wh, wh); |
264 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(),
circle, sigma); | 266 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(),
circle, sigma); |
265 } | 267 } |
266 | 268 |
267 #endif | 269 #endif |
OLD | NEW |