| 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 paint.setTextSize(160); | 119 paint.setTextSize(160); |
| 120 } | 120 } |
| 121 const SkTextBlobBuilder::RunBuffer& run = builder.allocR
un(paint, | 121 const SkTextBlobBuilder::RunBuffer& run = builder.allocR
un(paint, |
| 122
maxTotalText, | 122
maxTotalText, |
| 123
0, 0, | 123
0, 0, |
| 124
nullptr); | 124
nullptr); |
| 125 memcpy(run.glyphs, text.get(), maxTotalText * sizeof(uin
t16_t)); | 125 memcpy(run.glyphs, text.get(), maxTotalText * sizeof(uin
t16_t)); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 SkNEW_APPEND_TO_TARRAY(&blobs, TextBlobWrapper, (builder.build())); | 129 blobs.emplace_back(builder.build()); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 // create surface where LCD is impossible | 133 // create surface where LCD is impossible |
| 134 info = SkImageInfo::MakeN32Premul(kWidth, kHeight); | 134 info = SkImageInfo::MakeN32Premul(kWidth, kHeight); |
| 135 SkSurfaceProps propsNoLCD(0, kUnknown_SkPixelGeometry); | 135 SkSurfaceProps propsNoLCD(0, kUnknown_SkPixelGeometry); |
| 136 SkAutoTUnref<SkSurface> surfaceNoLCD(canvas->newSurface(info, &propsNoLCD)); | 136 SkAutoTUnref<SkSurface> surfaceNoLCD(canvas->newSurface(info, &propsNoLCD)); |
| 137 REPORTER_ASSERT(reporter, surface); | 137 REPORTER_ASSERT(reporter, surface); |
| 138 if (!surface) { | 138 if (!surface) { |
| 139 return; | 139 return; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobAbnormal, reporter, context) { | 168 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobAbnormal, reporter, context) { |
| 169 text_blob_cache_inner(reporter, context, 256, 256, 10, false, false); | 169 text_blob_cache_inner(reporter, context, 256, 256, 10, false, false); |
| 170 } | 170 } |
| 171 | 171 |
| 172 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobStressAbnormal, reporter, context) { | 172 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobStressAbnormal, reporter, context) { |
| 173 text_blob_cache_inner(reporter, context, 256, 256, 10, false, true); | 173 text_blob_cache_inner(reporter, context, 256, 256, 10, false, true); |
| 174 } | 174 } |
| 175 #endif | 175 #endif |
| OLD | NEW |