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 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DCShader); | 30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DCShader); |
31 | 31 |
32 void flatten(SkWriteBuffer& buf) const SK_OVERRIDE { | 32 void flatten(SkWriteBuffer& buf) const SK_OVERRIDE { |
33 buf.writeMatrix(fDeviceMatrix); | 33 buf.writeMatrix(fDeviceMatrix); |
34 } | 34 } |
35 | 35 |
36 bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& v
iewM, | 36 bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& v
iewM, |
37 const SkMatrix* localMatrix, GrColor* color, | 37 const SkMatrix* localMatrix, GrColor* color, |
38 GrFragmentProcessor** fp) const SK_OVERRIDE; | 38 GrFragmentProcessor** fp) const SK_OVERRIDE; |
| 39 |
| 40 #ifndef SK_IGNORE_TO_STRING |
| 41 void toString(SkString* str) const SK_OVERRIDE { |
| 42 str->appendf("DCShader: ()"); |
| 43 } |
| 44 #endif |
| 45 |
39 private: | 46 private: |
40 const SkMatrix fDeviceMatrix; | 47 const SkMatrix fDeviceMatrix; |
41 }; | 48 }; |
42 | 49 |
43 SkFlattenable* DCShader::CreateProc(SkReadBuffer& buf) { | 50 SkFlattenable* DCShader::CreateProc(SkReadBuffer& buf) { |
44 SkMatrix matrix; | 51 SkMatrix matrix; |
45 buf.readMatrix(&matrix); | 52 buf.readMatrix(&matrix); |
46 return SkNEW_ARGS(DCShader, (matrix)); | 53 return SkNEW_ARGS(DCShader, (matrix)); |
47 } | 54 } |
48 | 55 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 }; | 308 }; |
302 | 309 |
303 SkTArray<Prim*> fPrims; | 310 SkTArray<Prim*> fPrims; |
304 | 311 |
305 typedef GM INHERITED; | 312 typedef GM INHERITED; |
306 }; | 313 }; |
307 | 314 |
308 DEF_GM( return SkNEW(DCShaderGM); ) | 315 DEF_GM( return SkNEW(DCShaderGM); ) |
309 } | 316 } |
310 #endif | 317 #endif |
OLD | NEW |