| 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 #include "GrAtlasTextContext.h" | 7 #include "GrAtlasTextContext.h" |
| 8 | 8 |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 static SkSurfaceProps gSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType
); | 382 static SkSurfaceProps gSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType
); |
| 383 | 383 |
| 384 if (context->uniqueID() != gContextID) { | 384 if (context->uniqueID() != gContextID) { |
| 385 gContextID = context->uniqueID(); | 385 gContextID = context->uniqueID(); |
| 386 delete gTextContext; | 386 delete gTextContext; |
| 387 | 387 |
| 388 gTextContext = GrAtlasTextContext::Create(); | 388 gTextContext = GrAtlasTextContext::Create(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 // Setup dummy SkPaint / GrPaint / GrDrawContext | 391 // Setup dummy SkPaint / GrPaint / GrDrawContext |
| 392 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr
ox, 1024, 1024, | 392 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp
rox, 1024, 1024, |
| 393 kSkia8888_GrPixelCo
nfig, nullptr)); | 393 kSkia8888_GrPixelC
onfig, nullptr)); |
| 394 | 394 |
| 395 GrColor color = GrRandomColor(random); | 395 GrColor color = GrRandomColor(random); |
| 396 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); | 396 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
| 397 SkPaint skPaint; | 397 SkPaint skPaint; |
| 398 skPaint.setColor(color); | 398 skPaint.setColor(color); |
| 399 skPaint.setLCDRenderText(random->nextBool()); | 399 skPaint.setLCDRenderText(random->nextBool()); |
| 400 skPaint.setAntiAlias(skPaint.isLCDRenderText() ? true : random->nextBool()); | 400 skPaint.setAntiAlias(skPaint.isLCDRenderText() ? true : random->nextBool()); |
| 401 skPaint.setSubpixelText(random->nextBool()); | 401 skPaint.setSubpixelText(random->nextBool()); |
| 402 | 402 |
| 403 GrPaint grPaint; | 403 GrPaint grPaint; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 427 viewMatrix, | 427 viewMatrix, |
| 428 gSurfaceProps, text, | 428 gSurfaceProps, text, |
| 429 static_cast<size_t>(textLen), x,
y)); | 429 static_cast<size_t>(textLen), x,
y)); |
| 430 | 430 |
| 431 return blob->test_createBatch(textLen, 0, 0, viewMatrix, x, y, color, skPain
t, | 431 return blob->test_createBatch(textLen, 0, 0, viewMatrix, x, y, color, skPain
t, |
| 432 gSurfaceProps, gTextContext->dfAdjustTable(), | 432 gSurfaceProps, gTextContext->dfAdjustTable(), |
| 433 context->getBatchFontCache()); | 433 context->getBatchFontCache()); |
| 434 } | 434 } |
| 435 | 435 |
| 436 #endif | 436 #endif |
| OLD | NEW |