| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |