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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 case 1: | 67 case 1: |
68 surface->getCanvas()->clear(color); | 68 surface->getCanvas()->clear(color); |
69 break; | 69 break; |
70 case 2: | 70 case 2: |
71 SkColorShader shader(color); | 71 SkColorShader shader(color); |
72 SkPaint paint; | 72 SkPaint paint; |
73 paint.setShader(&shader); | 73 paint.setShader(&shader); |
74 surface->getCanvas()->drawPaint(paint); | 74 surface->getCanvas()->drawPaint(paint); |
75 break; | 75 break; |
76 } | 76 } |
77 surface->draw(canvas, 10*x, 10*y, NULL); | 77 surface->draw(canvas, 10.f*x, 10.f*y, NULL); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 surface->getCanvas()->discard(); | 81 surface->getCanvas()->discard(); |
82 surface->unref(); | 82 surface->unref(); |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 typedef GM INHERITED; | 86 typedef GM INHERITED; |
87 }; | 87 }; |
88 | 88 |
89 ////////////////////////////////////////////////////////////////////////////// | 89 ////////////////////////////////////////////////////////////////////////////// |
90 | 90 |
91 DEF_GM( return SkNEW(DiscardGM); ) | 91 DEF_GM( return SkNEW(DiscardGM); ) |
92 | 92 |
93 } // end namespace | 93 } // end namespace |
94 | 94 |
95 #endif | 95 #endif |
OLD | NEW |