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

Side by Side Diff: gm/textblobgeometrychange.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/surface.cpp ('k') | gm/textblobmixedsizes.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 BD-style license that can be 4 * Use of this source code is governed by a BD-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 "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 26 matching lines...) Expand all
37 paint.setLCDRenderText(true); 37 paint.setLCDRenderText(true);
38 38
39 SkTextBlobBuilder builder; 39 SkTextBlobBuilder builder;
40 40
41 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, 10); 41 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, 10);
42 42
43 SkAutoTUnref<const SkTextBlob> blob(builder.build()); 43 SkAutoTUnref<const SkTextBlob> blob(builder.build());
44 44
45 SkImageInfo info = SkImageInfo::MakeN32(200, 200, kPremul_SkAlphaType, 45 SkImageInfo info = SkImageInfo::MakeN32(200, 200, kPremul_SkAlphaType,
46 sk_ref_sp(canvas->imageInfo().co lorSpace())); 46 sk_ref_sp(canvas->imageInfo().co lorSpace()));
47 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); 47 SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
48 uint32_t gammaCorrect = canvas->getProps(&canvasProps)
49 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
50 SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry);
51 auto surface = canvas->makeSurface(info, &props); 48 auto surface = canvas->makeSurface(info, &props);
52 if (!surface) { 49 if (!surface) {
53 surface = SkSurface::MakeRaster(info, &props); 50 surface = SkSurface::MakeRaster(info, &props);
54 } 51 }
55 SkCanvas* c = surface->getCanvas(); 52 SkCanvas* c = surface->getCanvas();
56 53
57 // LCD text on white background 54 // LCD text on white background
58 SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f); 55 SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f);
59 SkPaint rectPaint; 56 SkPaint rectPaint;
60 rectPaint.setColor(0xffffffff); 57 rectPaint.setColor(0xffffffff);
(...skipping 11 matching lines...) Expand all
72 static const int kWidth = 200; 69 static const int kWidth = 200;
73 static const int kHeight = 200; 70 static const int kHeight = 200;
74 71
75 typedef GM INHERITED; 72 typedef GM INHERITED;
76 }; 73 };
77 74
78 ////////////////////////////////////////////////////////////////////////////// 75 //////////////////////////////////////////////////////////////////////////////
79 76
80 DEF_GM(return new TextBlobGeometryChange;) 77 DEF_GM(return new TextBlobGeometryChange;)
81 } 78 }
OLDNEW
« no previous file with comments | « gm/surface.cpp ('k') | gm/textblobmixedsizes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698