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

Side by Side Diff: gm/dftext.cpp

Issue 583453002: SkCanvas::drawImage is the new way for drawing an SkImage to a Canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@refactor_skImage
Patch Set: Make SkImage::draw public temporary for compatibility reasons Created 6 years, 3 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 | « no previous file | gm/image.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 "SkSurface.h" 8 #include "SkSurface.h"
9 #include "SkTypeface.h" 9 #include "SkTypeface.h"
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 paint.setColor(fg[i]); 169 paint.setColor(fg[i]);
170 170
171 canvas->drawText(text, textLen, x, y, paint); 171 canvas->drawText(text, textLen, x, y, paint);
172 y += paint.getFontMetrics(NULL); 172 y += paint.getFontMetrics(NULL);
173 } 173 }
174 174
175 #if SK_SUPPORT_GPU 175 #if SK_SUPPORT_GPU
176 // render offscreen buffer 176 // render offscreen buffer
177 if (surface) { 177 if (surface) {
178 SkImage* image = surface->newImageSnapshot(); 178 SkImage* image = surface->newImageSnapshot();
179 image->draw(inputCanvas, 0, 0, NULL); 179 inputCanvas->drawImage(image, 0, 0, NULL);
180 image->unref(); 180 image->unref();
181 } 181 }
182 #endif 182 #endif
183 } 183 }
184 184
185 private: 185 private:
186 typedef GM INHERITED; 186 typedef GM INHERITED;
187 }; 187 };
188 188
189 ////////////////////////////////////////////////////////////////////////////// 189 //////////////////////////////////////////////////////////////////////////////
190 190
191 static GM* MyFactory(void*) { return new DFTextGM; } 191 static GM* MyFactory(void*) { return new DFTextGM; }
192 static GMRegistry reg(MyFactory); 192 static GMRegistry reg(MyFactory);
193 193
194 } 194 }
OLDNEW
« no previous file with comments | « no previous file | gm/image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698