OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
11 #include "GrFragmentProcessor.h" | 11 #include "GrFragmentProcessor.h" |
12 #include "GrCoordTransform.h" | 12 #include "GrCoordTransform.h" |
13 #include "gl/GrGLProcessor.h" | 13 #include "gl/GrGLProcessor.h" |
14 #include "gl/builders/GrGLProgramBuilder.h" | 14 #include "gl/builders/GrGLProgramBuilder.h" |
15 #include "Resources.h" | 15 #include "Resources.h" |
16 #include "SkShader.h" | 16 #include "SkShader.h" |
17 #include "SkStream.h" | 17 #include "SkStream.h" |
18 #include "SkTypeface.h" | 18 #include "SkTypeface.h" |
19 | 19 |
20 namespace skiagm { | 20 namespace skiagm { |
21 | 21 |
22 /////////////////////////////////////////////////////////////////////////////// | 22 /////////////////////////////////////////////////////////////////////////////// |
23 | 23 |
24 class DCShader : public SkShader { | 24 class DCShader : public SkShader { |
25 public: | 25 public: |
26 DCShader(const SkMatrix& matrix) : fDeviceMatrix(matrix) {} | 26 DCShader(const SkMatrix& matrix) : fDeviceMatrix(matrix) {} |
27 | 27 |
reed1
2015/01/05 16:27:59
// We're not flattenable because ...
hal.canary
2015/01/05 16:37:25
I don't care about serializing custom shaders, sin
| |
28 Factory getFactory() const SK_OVERRIDE { return NULL; } | 28 SK_DECLARE_NOT_FLATTENABLE_PROCS(DCShader) |
29 | 29 |
30 bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& v iewM, | 30 bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& v iewM, |
31 const SkMatrix* localMatrix, GrColor* color, | 31 const SkMatrix* localMatrix, GrColor* color, |
32 GrFragmentProcessor** fp) const SK_OVERRIDE; | 32 GrFragmentProcessor** fp) const SK_OVERRIDE; |
33 private: | 33 private: |
34 const SkMatrix fDeviceMatrix; | 34 const SkMatrix fDeviceMatrix; |
35 }; | 35 }; |
36 | 36 |
37 class DCFP : public GrFragmentProcessor { | 37 class DCFP : public GrFragmentProcessor { |
38 public: | 38 public: |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 }; | 289 }; |
290 | 290 |
291 SkTArray<Prim*> fPrims; | 291 SkTArray<Prim*> fPrims; |
292 | 292 |
293 typedef GM INHERITED; | 293 typedef GM INHERITED; |
294 }; | 294 }; |
295 | 295 |
296 DEF_GM( return SkNEW(DCShaderGM); ) | 296 DEF_GM( return SkNEW(DCShaderGM); ) |
297 } | 297 } |
298 #endif | 298 #endif |
OLD | NEW |