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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 modeString.append("x"); | 99 modeString.append("x"); |
100 | 100 |
101 fTimer.start(); | 101 fTimer.start(); |
102 | 102 |
103 canvas->save(); | 103 canvas->save(); |
104 | 104 |
105 #if SK_SUPPORT_GPU | 105 #if SK_SUPPORT_GPU |
106 SkBaseDevice* device = canvas->getDevice_just_for_deprecated_compatibili
ty_testing(); | 106 SkBaseDevice* device = canvas->getDevice_just_for_deprecated_compatibili
ty_testing(); |
107 GrContext* grContext = canvas->getGrContext(); | 107 GrContext* grContext = canvas->getGrContext(); |
108 if (grContext) { | 108 if (grContext) { |
109 grContext->drawFontCache(SkRect::MakeXYWH(512, 10, 512, 512), kA8_Gr
MaskFormat, paint, | 109 GrTexture* tex = grContext->getFontAtlasTexture(GrMaskFormat::kA8_Gr
MaskFormat); |
110 reinterpret_cast<SkGpuDevice*>(device)->acc
essRenderTarget()); | 110 reinterpret_cast<SkGpuDevice*>(device)->drawTexture(tex, |
| 111 SkRect::MakeXYWH(512, 10,
512, 512), paint); |
111 } | 112 } |
112 #endif | 113 #endif |
113 canvas->translate(180, 180); | 114 canvas->translate(180, 180); |
114 canvas->rotate(fRotation); | 115 canvas->rotate(fRotation); |
115 canvas->scale(fScale, fScale); | 116 canvas->scale(fScale, fScale); |
116 canvas->translate(-180, -180); | 117 canvas->translate(-180, -180); |
117 | 118 |
118 const char* text = "Hamburgefons"; | 119 const char* text = "Hamburgefons"; |
119 size_t length = strlen(text); | 120 size_t length = strlen(text); |
120 | 121 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 int fCurrentTime; | 156 int fCurrentTime; |
156 | 157 |
157 | 158 |
158 typedef SampleView INHERITED; | 159 typedef SampleView INHERITED; |
159 }; | 160 }; |
160 | 161 |
161 ////////////////////////////////////////////////////////////////////////////// | 162 ////////////////////////////////////////////////////////////////////////////// |
162 | 163 |
163 static SkView* MyFactory() { return new AnimatedTextView; } | 164 static SkView* MyFactory() { return new AnimatedTextView; } |
164 static SkViewRegister reg(MyFactory); | 165 static SkViewRegister reg(MyFactory); |
OLD | NEW |