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

Side by Side Diff: gm/dftext.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/complexclip_blur_tiled.cpp ('k') | gm/displacement.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 2011 Google Inc. 2 * Copyright 2011 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 #include "gm.h" 7 #include "gm.h"
8 #include "Resources.h" 8 #include "Resources.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 paint.setTypeface(fEmojiTypeface); 194 paint.setTypeface(fEmojiTypeface);
195 paint.setTextSize(SkIntToScalar(19)); 195 paint.setTextSize(SkIntToScalar(19));
196 canvas->drawText(fEmojiText, strlen(fEmojiText), 670, 90, paint); 196 canvas->drawText(fEmojiText, strlen(fEmojiText), 670, 90, paint);
197 } 197 }
198 #if SK_SUPPORT_GPU 198 #if SK_SUPPORT_GPU
199 // render offscreen buffer 199 // render offscreen buffer
200 if (surface) { 200 if (surface) {
201 SkAutoCanvasRestore acr(inputCanvas, true); 201 SkAutoCanvasRestore acr(inputCanvas, true);
202 // since we prepended this matrix already, we blit using identity 202 // since we prepended this matrix already, we blit using identity
203 inputCanvas->resetMatrix(); 203 inputCanvas->resetMatrix();
204 SkImage* image = surface->newImageSnapshot(); 204 inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nul lptr);
205 inputCanvas->drawImage(image, 0, 0, nullptr);
206 image->unref();
207 } 205 }
208 #endif 206 #endif
209 } 207 }
210 208
211 private: 209 private:
212 SkAutoTUnref<SkTypeface> fEmojiTypeface; 210 SkAutoTUnref<SkTypeface> fEmojiTypeface;
213 const char* fEmojiText; 211 const char* fEmojiText;
214 212
215 typedef skiagm::GM INHERITED; 213 typedef skiagm::GM INHERITED;
216 }; 214 };
217 215
218 DEF_GM(return new DFTextGM;) 216 DEF_GM(return new DFTextGM;)
OLDNEW
« no previous file with comments | « gm/complexclip_blur_tiled.cpp ('k') | gm/displacement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698