| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 canvas->imageInfo().profil
eType()); | 104 canvas->imageInfo().profil
eType()); |
| 105 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); | 105 SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); |
| 106 uint32_t allowSRGBInputs = canvas->getProps(&canvasProps) | 106 uint32_t gammaCorrect = canvas->getProps(&canvasProps) |
| 107 ? canvasProps.flags() & SkSurfaceProps::kAllowSRGBInputs_Flag : 0; | 107 ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0; |
| 108 SkSurfaceProps props(allowSRGBInputs, kUnknown_SkPixelGeometry); | 108 SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry); |
| 109 auto surface(canvas->makeSurface(info, &props)); | 109 auto surface(canvas->makeSurface(info, &props)); |
| 110 if (surface) { | 110 if (surface) { |
| 111 SkPaint paint; | 111 SkPaint paint; |
| 112 paint.setAntiAlias(true); | 112 paint.setAntiAlias(true); |
| 113 | 113 |
| 114 SkCanvas* c = surface->getCanvas(); | 114 SkCanvas* c = surface->getCanvas(); |
| 115 | 115 |
| 116 int stride = SkScalarCeilToInt(fBlob->bounds().height()); | 116 int stride = SkScalarCeilToInt(fBlob->bounds().height()); |
| 117 int yOffset = stride / 8; | 117 int yOffset = stride / 8; |
| 118 for (int i = 0; i < 1; i++) { | 118 for (int i = 0; i < 1; i++) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 148 static const int kHeight = 1600; | 148 static const int kHeight = 1600; |
| 149 | 149 |
| 150 typedef GM INHERITED; | 150 typedef GM INHERITED; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 ////////////////////////////////////////////////////////////////////////////// | 153 ////////////////////////////////////////////////////////////////////////////// |
| 154 | 154 |
| 155 DEF_GM(return new TextBlobRandomFont;) | 155 DEF_GM(return new TextBlobRandomFont;) |
| 156 } | 156 } |
| 157 #endif | 157 #endif |
| OLD | NEW |