From ab61fb8b5f3e7fc807bd335fcfe088d2d0fcb13a Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Thu, 23 Feb 2017 07:48:11 -0500 Subject: [PATCH 1/2] Update framework to use new method for disabling DF path rendering. Test: compile only Change-Id: Ifa690a0af01cb6b07c4fd303302cb6a557e8dfde --- libs/hwui/renderthread/EglManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp index 860725b37f8b0..44af5fd8d0dde 100644 --- a/libs/hwui/renderthread/EglManager.cpp +++ b/libs/hwui/renderthread/EglManager.cpp @@ -133,7 +133,7 @@ void EglManager::initialize() { LOG_ALWAYS_FATAL_IF(!glInterface.get()); GrContextOptions options; - options.fDisableDistanceFieldPaths = true; + options.fGpuPathRenderers &= ~GrContextOptions::GpuPathRenderers::kDistanceField; options.fAllowPathMaskCaching = true; mRenderThread.setGrContext(GrContext::Create(GrBackend::kOpenGL_GrBackend, (GrBackendContext)glInterface.get(), options)); From f77ca0872102116f58693d26703af8279573d014 Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Thu, 23 Feb 2017 09:33:53 -0500 Subject: [PATCH 2/2] Fix HWUI tests to use android-only SkPaint flags Test: compile only Change-Id: Ia3a5710d4ae13d68e5b2655a8b135dae8ffeb513 --- libs/hwui/tests/unit/FrameBuilderTests.cpp | 2 +- libs/hwui/tests/unit/RecordingCanvasTests.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/hwui/tests/unit/FrameBuilderTests.cpp b/libs/hwui/tests/unit/FrameBuilderTests.cpp index a391d1e61a57f..95d9459e898cc 100644 --- a/libs/hwui/tests/unit/FrameBuilderTests.cpp +++ b/libs/hwui/tests/unit/FrameBuilderTests.cpp @@ -579,7 +579,7 @@ RENDERTHREAD_OPENGL_PIPELINE_TEST(FrameBuilder, textStrikethrough) { SkPaint textPaint; textPaint.setAntiAlias(true); textPaint.setTextSize(20); - textPaint.setStrikeThruText(true); + textPaint.setFlags(textPaint.getFlags() | SkPaint::kStrikeThruText_ReserveFlag); textPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); for (int i = 0; i < LOOPS; i++) { TestUtils::drawUtf8ToCanvas(&canvas, "test text", textPaint, 10, 100 * (i + 1)); diff --git a/libs/hwui/tests/unit/RecordingCanvasTests.cpp b/libs/hwui/tests/unit/RecordingCanvasTests.cpp index 669f03c710001..f48d98ce4934a 100644 --- a/libs/hwui/tests/unit/RecordingCanvasTests.cpp +++ b/libs/hwui/tests/unit/RecordingCanvasTests.cpp @@ -200,8 +200,10 @@ OPENGL_PIPELINE_TEST(RecordingCanvas, drawGlyphs_strikeThruAndUnderline) { paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { - paint.setUnderlineText(i != 0); - paint.setStrikeThruText(j != 0); + uint32_t flags = paint.getFlags(); + if (i != 0) flags |= SkPaint::kUnderlineText_ReserveFlag; + if (j != 0) flags |= SkPaint::kStrikeThruText_ReserveFlag; + paint.setFlags(flags); TestUtils::drawUtf8ToCanvas(&canvas, "test text", paint, 25, 25); } }