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

Side by Side Diff: gm/textblobmixedsizes.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/textblobgeometrychange.cpp ('k') | gm/textblobrandomfont.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 SkCanvas* canvas = inputCanvas; 99 SkCanvas* canvas = inputCanvas;
100 sk_sp<SkSurface> surface; 100 sk_sp<SkSurface> surface;
101 if (fUseDFT) { 101 if (fUseDFT) {
102 #if SK_SUPPORT_GPU 102 #if SK_SUPPORT_GPU
103 // Create a new Canvas to enable DFT 103 // Create a new Canvas to enable DFT
104 GrContext* ctx = inputCanvas->getGrContext(); 104 GrContext* ctx = inputCanvas->getGrContext();
105 SkISize size = onISize(); 105 SkISize size = onISize();
106 sk_sp<SkColorSpace> colorSpace = sk_ref_sp(inputCanvas->imageInfo(). colorSpace()); 106 sk_sp<SkColorSpace> colorSpace = sk_ref_sp(inputCanvas->imageInfo(). colorSpace());
107 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), 107 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(),
108 kPremul_SkAlphaType, colorSp ace); 108 kPremul_SkAlphaType, colorSp ace);
109 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType) ; 109 SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag ,
110 uint32_t gammaCorrect = inputCanvas->getProps(&canvasProps)
111 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0;
112 SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag | gammaCorrect,
113 SkSurfaceProps::kLegacyFontHost_InitType); 110 SkSurfaceProps::kLegacyFontHost_InitType);
114 surface = SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props); 111 surface = SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props);
115 canvas = surface.get() ? surface->getCanvas() : inputCanvas; 112 canvas = surface.get() ? surface->getCanvas() : inputCanvas;
116 // init our new canvas with the old canvas's matrix 113 // init our new canvas with the old canvas's matrix
117 canvas->setMatrix(inputCanvas->getTotalMatrix()); 114 canvas->setMatrix(inputCanvas->getTotalMatrix());
118 #endif 115 #endif
119 } 116 }
120 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE)); 117 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE));
121 118
122 SkRect bounds = fBlob->bounds(); 119 SkRect bounds = fBlob->bounds();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 typedef GM INHERITED; 187 typedef GM INHERITED;
191 }; 188 };
192 189
193 ////////////////////////////////////////////////////////////////////////////// 190 //////////////////////////////////////////////////////////////////////////////
194 191
195 DEF_GM( return new TextBlobMixedSizes(false); ) 192 DEF_GM( return new TextBlobMixedSizes(false); )
196 #if SK_SUPPORT_GPU 193 #if SK_SUPPORT_GPU
197 DEF_GM( return new TextBlobMixedSizes(true); ) 194 DEF_GM( return new TextBlobMixedSizes(true); )
198 #endif 195 #endif
199 } 196 }
OLDNEW
« no previous file with comments | « gm/textblobgeometrychange.cpp ('k') | gm/textblobrandomfont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698