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

Unified Diff: Source/platform/graphics/GraphicsContextTest.cpp

Issue 1168983002: Fix graphics context test to pass in slimming paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContextTest.cpp
diff --git a/Source/platform/graphics/GraphicsContextTest.cpp b/Source/platform/graphics/GraphicsContextTest.cpp
index b161d098239defe09ca05af842ef259f517698a3..11e5df43309ca50e79f39ab058efc3e3df410546 100644
--- a/Source/platform/graphics/GraphicsContextTest.cpp
+++ b/Source/platform/graphics/GraphicsContextTest.cpp
@@ -26,6 +26,7 @@
#include "platform/graphics/GraphicsContext.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/BitmapImage.h"
#include "platform/graphics/ImageBuffer.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -209,6 +210,11 @@ TEST(GraphicsContextTest, UnboundedDrawsAreClipped)
TEST(GraphicsContextTest, RecordingTotalMatrix)
{
+ if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
+ // GraphicsContext::getCTM() won't do the right thing in Slimming Paint, so just skip this test.
+ return;
+ }
+
SkBitmap bitmap;
bitmap.allocN32Pixels(400, 400);
bitmap.eraseColor(0);
@@ -261,8 +267,11 @@ TEST(GraphicsContextTest, RecordingCanvas)
SkCanvas* canvas2 = context->canvas();
EXPECT_TRUE(canvas2);
- EXPECT_NE(canvas1, canvas2);
- EXPECT_TRUE(canvas1->unique());
+ if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) {
chrishtr 2015/06/08 23:34:58 This test makes no sense in slimming paint, just d
wkorman 2015/06/08 23:38:29 Done.
+ // In Slimming Paint we may re-use the canvas based on SkPictureRecorder internals.
+ EXPECT_NE(canvas1, canvas2);
+ EXPECT_TRUE(canvas1->unique());
+ }
// endRecording finally makes the picture accessible
RefPtr<const SkPicture> picture = context->endRecording();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698