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

Side by Side Diff: gm/textblobrandomfont.cpp

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 void onDraw(SkCanvas* canvas) override { 94 void onDraw(SkCanvas* canvas) override {
95 // This GM exists to test a specific feature of the GPU backend. 95 // This GM exists to test a specific feature of the GPU backend.
96 if (nullptr == canvas->getGrContext()) { 96 if (nullptr == canvas->getGrContext()) {
97 skiagm::GM::DrawGpuOnlyMessage(canvas); 97 skiagm::GM::DrawGpuOnlyMessage(canvas);
98 return; 98 return;
99 } 99 }
100 100
101 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE)); 101 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE));
102 102
103 SkImageInfo info = SkImageInfo::MakeN32Premul(kWidth, kHeight); 103 SkImageInfo info = SkImageInfo::MakeN32Premul(kWidth, kHeight,
104 SkSurfaceProps props(0, kUnknown_SkPixelGeometry); 104 canvas->imageInfo().profil eType());
105 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType);
106 uint32_t allowSRGBInputs = canvas->getProps(&canvasProps)
107 ? canvasProps.flags() & SkSurfaceProps::kAllowSRGBInputs_Flag : 0;
108 SkSurfaceProps props(allowSRGBInputs, kUnknown_SkPixelGeometry);
105 auto surface(canvas->makeSurface(info, &props)); 109 auto surface(canvas->makeSurface(info, &props));
106 if (surface) { 110 if (surface) {
107 SkPaint paint; 111 SkPaint paint;
108 paint.setAntiAlias(true); 112 paint.setAntiAlias(true);
109 113
110 SkCanvas* c = surface->getCanvas(); 114 SkCanvas* c = surface->getCanvas();
111 115
112 int stride = SkScalarCeilToInt(fBlob->bounds().height()); 116 int stride = SkScalarCeilToInt(fBlob->bounds().height());
113 int yOffset = stride / 8; 117 int yOffset = stride / 8;
114 for (int i = 0; i < 1; i++) { 118 for (int i = 0; i < 1; i++) {
(...skipping 29 matching lines...) Expand all
144 static const int kHeight = 1600; 148 static const int kHeight = 1600;
145 149
146 typedef GM INHERITED; 150 typedef GM INHERITED;
147 }; 151 };
148 152
149 ////////////////////////////////////////////////////////////////////////////// 153 //////////////////////////////////////////////////////////////////////////////
150 154
151 DEF_GM(return new TextBlobRandomFont;) 155 DEF_GM(return new TextBlobRandomFont;)
152 } 156 }
153 #endif 157 #endif
OLDNEW
« no previous file with comments | « gm/textblobmixedsizes.cpp ('k') | gm/xfermodes3.cpp » ('j') | src/effects/SkImageSource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698