Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1363)

Side by Side Diff: gm/textblobmixedsizes.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/surface.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « gm/surface.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698