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

Side by Side Diff: gm/dftext.cpp

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome 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/bleed.cpp ('k') | gm/discard.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 virtual void onDraw(SkCanvas* inputCanvas) override { 44 virtual void onDraw(SkCanvas* inputCanvas) override {
45 SkScalar textSizes[] = { 9.0f, 9.0f*2.0f, 9.0f*5.0f, 9.0f*2.0f*5.0f }; 45 SkScalar textSizes[] = { 9.0f, 9.0f*2.0f, 9.0f*5.0f, 9.0f*2.0f*5.0f };
46 SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f }; 46 SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f };
47 47
48 // set up offscreen rendering with distance field text 48 // set up offscreen rendering with distance field text
49 #if SK_SUPPORT_GPU 49 #if SK_SUPPORT_GPU
50 GrContext* ctx = inputCanvas->getGrContext(); 50 GrContext* ctx = inputCanvas->getGrContext();
51 SkImageInfo info = SkImageInfo::MakeN32Premul(onISize()); 51 SkImageInfo info = SkImageInfo::MakeN32Premul(onISize());
52 SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag, 52 SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag,
53 SkSurfaceProps::kLegacyFontHost_InitType); 53 SkSurfaceProps::kLegacyFontHost_InitType);
54 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkSurfac e::kNo_Budgeted, 54 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkBudget ed::kNo,
55 info, 0, &pro ps)); 55 info, 0, &pro ps));
56 SkCanvas* canvas = surface.get() ? surface->getCanvas() : inputCanvas; 56 SkCanvas* canvas = surface.get() ? surface->getCanvas() : inputCanvas;
57 // init our new canvas with the old canvas's matrix 57 // init our new canvas with the old canvas's matrix
58 canvas->setMatrix(inputCanvas->getTotalMatrix()); 58 canvas->setMatrix(inputCanvas->getTotalMatrix());
59 #else 59 #else
60 SkCanvas* canvas = inputCanvas; 60 SkCanvas* canvas = inputCanvas;
61 #endif 61 #endif
62 // apply global scale to test glyph positioning 62 // apply global scale to test glyph positioning
63 canvas->scale(1.05f, 1.05f); 63 canvas->scale(1.05f, 1.05f);
64 canvas->clear(0xffffffff); 64 canvas->clear(0xffffffff);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 210
211 private: 211 private:
212 SkAutoTUnref<SkTypeface> fEmojiTypeface; 212 SkAutoTUnref<SkTypeface> fEmojiTypeface;
213 const char* fEmojiText; 213 const char* fEmojiText;
214 214
215 typedef skiagm::GM INHERITED; 215 typedef skiagm::GM INHERITED;
216 }; 216 };
217 217
218 DEF_GM(return new DFTextGM;) 218 DEF_GM(return new DFTextGM;)
OLDNEW
« no previous file with comments | « gm/bleed.cpp ('k') | gm/discard.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698