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

Side by Side Diff: gm/textblobrandomfont.cpp

Issue 2074103004: Revert of More removal of SkColorProfileType... (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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/textblobmixedsizes.cpp ('k') | gm/xfermodes3.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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 void onDraw(SkCanvas* canvas) override { 91 void onDraw(SkCanvas* canvas) override {
92 // This GM exists to test a specific feature of the GPU backend. 92 // This GM exists to test a specific feature of the GPU backend.
93 if (nullptr == canvas->getGrContext()) { 93 if (nullptr == canvas->getGrContext()) {
94 skiagm::GM::DrawGpuOnlyMessage(canvas); 94 skiagm::GM::DrawGpuOnlyMessage(canvas);
95 return; 95 return;
96 } 96 }
97 97
98 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE)); 98 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE));
99 99
100 SkImageInfo info = SkImageInfo::MakeN32(kWidth, kHeight, kPremul_SkAlpha Type, 100 SkImageInfo info = SkImageInfo::MakeN32Premul(kWidth, kHeight,
101 sk_ref_sp(canvas->imageInfo().co lorSpace())); 101 canvas->imageInfo().profil eType());
102 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); 102 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
103 uint32_t gammaCorrect = canvas->getProps(&canvasProps) 103 uint32_t gammaCorrect = canvas->getProps(&canvasProps)
104 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0; 104 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
105 SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry); 105 SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry);
106 auto surface(canvas->makeSurface(info, &props)); 106 auto surface(canvas->makeSurface(info, &props));
107 if (surface) { 107 if (surface) {
108 SkPaint paint; 108 SkPaint paint;
109 paint.setAntiAlias(true); 109 paint.setAntiAlias(true);
110 110
111 SkCanvas* c = surface->getCanvas(); 111 SkCanvas* c = surface->getCanvas();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 static const int kHeight = 1600; 145 static const int kHeight = 1600;
146 146
147 typedef GM INHERITED; 147 typedef GM INHERITED;
148 }; 148 };
149 149
150 ////////////////////////////////////////////////////////////////////////////// 150 //////////////////////////////////////////////////////////////////////////////
151 151
152 DEF_GM(return new TextBlobRandomFont;) 152 DEF_GM(return new TextBlobRandomFont;)
153 } 153 }
154 #endif 154 #endif
OLDNEW
« no previous file with comments | « gm/textblobmixedsizes.cpp ('k') | gm/xfermodes3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698