OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "gm.h" | 8 #include "gm.h" |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "GrFragmentProcessor.h" | 10 #include "GrFragmentProcessor.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 /////////////////////////////////////////////////////////////////////////////// | 26 /////////////////////////////////////////////////////////////////////////////// |
27 | 27 |
28 class DCShader : public SkShader { | 28 class DCShader : public SkShader { |
29 public: | 29 public: |
30 DCShader(const SkMatrix& matrix) : fDeviceMatrix(matrix) {} | 30 DCShader(const SkMatrix& matrix) : fDeviceMatrix(matrix) {} |
31 | 31 |
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DCShader); | 32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DCShader); |
33 | 33 |
34 void flatten(SkWriteBuffer& buf) const override { | 34 void flatten(SkWriteBuffer& buf) const override { |
35 buf.writeMatrix(fDeviceMatrix); | 35 buf.writeMatrix("fDeviceMatrix", fDeviceMatrix); |
36 } | 36 } |
37 | 37 |
38 const GrFragmentProcessor* asFragmentProcessor(GrContext*, | 38 const GrFragmentProcessor* asFragmentProcessor(GrContext*, |
39 const SkMatrix& viewM, | 39 const SkMatrix& viewM, |
40 const SkMatrix* localMatrix, | 40 const SkMatrix* localMatrix, |
41 SkFilterQuality) const overri
de; | 41 SkFilterQuality) const overri
de; |
42 | 42 |
43 #ifndef SK_IGNORE_TO_STRING | 43 #ifndef SK_IGNORE_TO_STRING |
44 void toString(SkString* str) const override { | 44 void toString(SkString* str) const override { |
45 str->appendf("DCShader: ()"); | 45 str->appendf("DCShader: ()"); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 }; | 290 }; |
291 | 291 |
292 SkTArray<Prim*> fPrims; | 292 SkTArray<Prim*> fPrims; |
293 | 293 |
294 typedef GM INHERITED; | 294 typedef GM INHERITED; |
295 }; | 295 }; |
296 | 296 |
297 DEF_GM(return new DCShaderGM;) | 297 DEF_GM(return new DCShaderGM;) |
298 } | 298 } |
299 #endif | 299 #endif |
OLD | NEW |