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 "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 } | 165 } |
166 canvas->restore(); | 166 canvas->restore(); |
167 | 167 |
168 #if SK_SUPPORT_GPU | 168 #if SK_SUPPORT_GPU |
169 // render offscreen buffer | 169 // render offscreen buffer |
170 if (surface) { | 170 if (surface) { |
171 SkAutoCanvasRestore acr(inputCanvas, true); | 171 SkAutoCanvasRestore acr(inputCanvas, true); |
172 // since we prepended this matrix already, we blit using identity | 172 // since we prepended this matrix already, we blit using identity |
173 inputCanvas->resetMatrix(); | 173 inputCanvas->resetMatrix(); |
174 SkImage* image = surface->newImageSnapshot(); | 174 inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nul
lptr); |
175 inputCanvas->drawImage(image, 0, 0, nullptr); | |
176 image->unref(); | |
177 } | 175 } |
178 #endif | 176 #endif |
179 } | 177 } |
180 | 178 |
181 private: | 179 private: |
182 SkAutoTUnref<const SkTextBlob> fBlob; | 180 SkAutoTUnref<const SkTextBlob> fBlob; |
183 | 181 |
184 static const int kWidth = 2000; | 182 static const int kWidth = 2000; |
185 static const int kHeight = 2000; | 183 static const int kHeight = 2000; |
186 | 184 |
187 bool fUseDFT; | 185 bool fUseDFT; |
188 | 186 |
189 typedef GM INHERITED; | 187 typedef GM INHERITED; |
190 }; | 188 }; |
191 | 189 |
192 ////////////////////////////////////////////////////////////////////////////// | 190 ////////////////////////////////////////////////////////////////////////////// |
193 | 191 |
194 DEF_GM( return new TextBlobMixedSizes(false); ) | 192 DEF_GM( return new TextBlobMixedSizes(false); ) |
195 #if SK_SUPPORT_GPU | 193 #if SK_SUPPORT_GPU |
196 DEF_GM( return new TextBlobMixedSizes(true); ) | 194 DEF_GM( return new TextBlobMixedSizes(true); ) |
197 #endif | 195 #endif |
198 } | 196 } |
OLD | NEW |