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

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

Issue 413313002: Treat calls to CanvasRenderingContext2D.clearRect as operations that clear the canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
Index: Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
diff --git a/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp b/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
index 3237ea71b1cac1477f1878462693ed3db99f1c27..ca7a88880d15b7deb823a09f662fcf56644e7208 100644
--- a/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
+++ b/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
@@ -6,6 +6,7 @@
#include "platform/graphics/RecordingImageBufferSurface.h"
+#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/ImageBuffer.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
@@ -80,6 +81,16 @@ protected:
m_testSurface->getPicture();
expectDisplayListEnabled(true);
}
+
+ void testClearRect()
+ {
+ m_testSurface->initializeCurrentFrame();
+ m_testSurface->getPicture();
+ m_imageBuffer->context()->clearRect(FloatRect(FloatPoint(0, 0), FloatSize(m_testSurface->size())));
+ m_testSurface->willUse();
+ m_testSurface->getPicture();
+ expectDisplayListEnabled(true);
+ }
private:
void expectDisplayListEnabled(bool displayListEnabled)
{
@@ -118,4 +129,9 @@ TEST_F(RecordingImageBufferSurfaceTest, testAnimatedWithClear)
testAnimatedWithClear();
}
+TEST_F(RecordingImageBufferSurfaceTest, testClearRect)
+{
+ testClearRect();
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698