From 344e9037e1befdee76691a1239a47829e6af4ea5 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 11 Dec 2017 15:42:09 -0700 Subject: Prefer fullscreen clears on Qualcomm/GL Adds Qualcomm to the set of GL devices on which we prefer fullscreen clears. Renames fullscreenClearIsFree in GrCaps to preferFullscreenClears. Replaces 'bool canIgnoreClip' on GrRenderTargetContext::clear with an enum. Bug: skia: Change-Id: I5b30298c4d0b092c398b9fea6060f3e2bea91e46 Reviewed-on: https://skia-review.googlesource.com/83060 Reviewed-by: Brian Salomon Reviewed-by: Robert Phillips Commit-Queue: Chris Dalton --- tests/ClearTest.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'tests/ClearTest.cpp') diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp index fca031824c..7424c5a3b5 100644 --- a/tests/ClearTest.cpp +++ b/tests/ClearTest.cpp @@ -79,7 +79,7 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Check a full clear - rtContext->clear(&fullRect, kColor1, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue, failX, failY); @@ -89,8 +89,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Check two full clears, same color - rtContext->clear(&fullRect, kColor1, false); - rtContext->clear(&fullRect, kColor1, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue, failX, failY); @@ -100,8 +100,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Check two full clears, different colors - rtContext->clear(&fullRect, kColor1, false); - rtContext->clear(&fullRect, kColor2, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&fullRect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), fullRect, kColor2, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue, failX, failY); @@ -111,8 +111,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Test a full clear followed by a same color inset clear - rtContext->clear(&fullRect, kColor1, false); - rtContext->clear(&mid1Rect, kColor1, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&mid1Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue, failX, failY); @@ -122,8 +122,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Test a inset clear followed by same color full clear - rtContext->clear(&mid1Rect, kColor1, false); - rtContext->clear(&fullRect, kColor1, false); + rtContext->clear(&mid1Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue, failX, failY); @@ -133,8 +133,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Test a full clear followed by a different color inset clear - rtContext->clear(&fullRect, kColor1, false); - rtContext->clear(&mid1Rect, kColor2, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue, failX, failY); @@ -151,8 +151,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Test a inset clear followed by a different full clear - rtContext->clear(&mid1Rect, kColor2, false); - rtContext->clear(&fullRect, kColor1, false); + rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue, failX, failY); @@ -163,9 +163,9 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { // Check three nested clears from largest to smallest where outermost and innermost are same // color. - rtContext->clear(&fullRect, kColor1, false); - rtContext->clear(&mid1Rect, kColor2, false); - rtContext->clear(&mid2Rect, kColor1, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&mid2Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), mid2Rect, kColor1, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue, failX, failY); @@ -189,9 +189,9 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) { SkASSERT(rtContext); // Swap the order of the second two clears in the above test. - rtContext->clear(&fullRect, kColor1, false); - rtContext->clear(&mid2Rect, kColor1, false); - rtContext->clear(&mid1Rect, kColor2, false); + rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&mid2Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo); + rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo); if (!check_rect(rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) { ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue, failX, failY); -- cgit v1.2.3