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

Side by Side Diff: gm/textblobrandomfont.cpp

Issue 2188463002: Remove SkSurfaceProps gamma-correctness flag entirely. (Closed) Base URL: https://skia.googlesource.com/skia.git@remove-is-gamma-correct
Patch Set: Created 4 years, 4 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') | include/core/SkSurfaceProps.h » ('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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::MakeN32(kWidth, kHeight, kPremul_SkAlpha Type,
101 sk_ref_sp(canvas->imageInfo().co lorSpace())); 101 sk_ref_sp(canvas->imageInfo().co lorSpace()));
102 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); 102 SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
103 uint32_t gammaCorrect = canvas->getProps(&canvasProps)
104 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
105 SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry);
106 auto surface(canvas->makeSurface(info, &props)); 103 auto surface(canvas->makeSurface(info, &props));
107 if (surface) { 104 if (surface) {
108 SkPaint paint; 105 SkPaint paint;
109 paint.setAntiAlias(true); 106 paint.setAntiAlias(true);
110 107
111 SkCanvas* c = surface->getCanvas(); 108 SkCanvas* c = surface->getCanvas();
112 109
113 int stride = SkScalarCeilToInt(fBlob->bounds().height()); 110 int stride = SkScalarCeilToInt(fBlob->bounds().height());
114 int yOffset = stride / 8; 111 int yOffset = stride / 8;
115 for (int i = 0; i < 1; i++) { 112 for (int i = 0; i < 1; i++) {
(...skipping 29 matching lines...) Expand all
145 static const int kHeight = 1600; 142 static const int kHeight = 1600;
146 143
147 typedef GM INHERITED; 144 typedef GM INHERITED;
148 }; 145 };
149 146
150 ////////////////////////////////////////////////////////////////////////////// 147 //////////////////////////////////////////////////////////////////////////////
151 148
152 DEF_GM(return new TextBlobRandomFont;) 149 DEF_GM(return new TextBlobRandomFont;)
153 } 150 }
154 #endif 151 #endif
OLDNEW
« no previous file with comments | « gm/textblobmixedsizes.cpp ('k') | include/core/SkSurfaceProps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698