| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // This GM exists to test a specific feature of the GPU backend. | 95 // This GM exists to test a specific feature of the GPU backend. |
| 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 SkSurfaceProps props(0, kUnknown_SkPixelGeometry); | 104 SkSurfaceProps props(0, kUnknown_SkPixelGeometry); |
| 105 SkAutoTUnref<SkSurface> surface(canvas->newSurface(info, &props)); | 105 auto surface(canvas->makeSurface(info, &props)); |
| 106 if (surface) { | 106 if (surface) { |
| 107 SkPaint paint; | 107 SkPaint paint; |
| 108 paint.setAntiAlias(true); | 108 paint.setAntiAlias(true); |
| 109 | 109 |
| 110 SkCanvas* c = surface->getCanvas(); | 110 SkCanvas* c = surface->getCanvas(); |
| 111 | 111 |
| 112 int stride = SkScalarCeilToInt(fBlob->bounds().height()); | 112 int stride = SkScalarCeilToInt(fBlob->bounds().height()); |
| 113 int yOffset = stride / 8; | 113 int yOffset = stride / 8; |
| 114 for (int i = 0; i < 1; i++) { | 114 for (int i = 0; i < 1; i++) { |
| 115 // fiddle the canvas to force regen of textblobs | 115 // fiddle the canvas to force regen of textblobs |
| (...skipping 28 matching lines...) Expand all Loading... |
| 144 static const int kHeight = 1600; | 144 static const int kHeight = 1600; |
| 145 | 145 |
| 146 typedef GM INHERITED; | 146 typedef GM INHERITED; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 ////////////////////////////////////////////////////////////////////////////// | 149 ////////////////////////////////////////////////////////////////////////////// |
| 150 | 150 |
| 151 DEF_GM(return new TextBlobRandomFont;) | 151 DEF_GM(return new TextBlobRandomFont;) |
| 152 } | 152 } |
| 153 #endif | 153 #endif |
| OLD | NEW |