Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1364)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp

Issue 2013723002: Consider ClipPathDisplayItems for GPU veto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test asserts Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
index 8692c1193ec6b5c4729d007645dbcbf99f4d5dd6..3768a15cbf8cd9a846f7a3e045f7cd47f47b6fcf 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -7,6 +7,7 @@
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/paint/CachedDisplayItem.h"
+#include "platform/graphics/paint/ClipPathDisplayItem.h"
#include "platform/graphics/paint/ClipPathRecorder.h"
#include "platform/graphics/paint/ClipRecorder.h"
#include "platform/graphics/paint/DrawingDisplayItem.h"
@@ -905,4 +906,27 @@ TEST_F(PaintControllerTest, IsNotSuitableForGpuRasterizationSinglePictureManyPat
EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRasterization());
}
+TEST_F(PaintControllerTest, IsNotSuitableForGpuRasterizationConcaveClipPath)
+{
+ Path path;
+ path.addLineTo(FloatPoint(50, 50));
+ path.addLineTo(FloatPoint(100, 0));
+ path.addLineTo(FloatPoint(50, 100));
+ path.closeSubpath();
+
+ FakeDisplayItemClient client("test client", LayoutRect(0, 0, 200, 100));
+ GraphicsContext context(getPaintController());
+
+ // Run twice for empty/non-empty m_currentPaintArtifact coverage.
+ for (int i = 0; i < 2; ++i) {
+ for (int j = 0; j < 50; ++j)
+ getPaintController().createAndAppend<BeginClipPathDisplayItem>(client, path);
+ drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+ for (int j = 0; j < 50; ++j)
+ getPaintController().createAndAppend<EndClipPathDisplayItem>(client);
+ getPaintController().commitNewDisplayItems(LayoutSize());
+ EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRasterization());
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698