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

Unified Diff: Source/platform/graphics/paint/ClipDisplayItem.cpp

Issue 702633002: Move ViewDisplayList to GraphicsLayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: copy & pasted test expectation from the wrong window. sorry. :( Created 6 years, 1 month 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 | « Source/platform/graphics/paint/ClipDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/ClipDisplayItem.cpp
diff --git a/Source/platform/graphics/paint/ClipDisplayItem.cpp b/Source/platform/graphics/paint/ClipDisplayItem.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6fb17807e84c014401196a78faf44ba83e4f8983
--- /dev/null
+++ b/Source/platform/graphics/paint/ClipDisplayItem.cpp
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/graphics/paint/ClipDisplayItem.h"
+
+#include "platform/geometry/RoundedRect.h"
+#include "platform/graphics/GraphicsContext.h"
+
+namespace blink {
+
+void ClipDisplayItem::replay(GraphicsContext* context)
+{
+ context->save();
+ context->clip(m_clipRect);
+ for (RoundedRect roundedRect : m_roundedRectClips)
+ context->clipRoundedRect(roundedRect);
+}
+
+void EndClipDisplayItem::replay(GraphicsContext* context)
+{
+ context->restore();
+}
+
+#ifndef NDEBUG
+WTF::String ClipDisplayItem::asDebugString() const
+{
+ return String::format("{%s, type: \"%s\", clipRect: [%d,%d,%d,%d]}",
+ clientDebugString().utf8().data(), typeAsDebugString(type()).utf8().data(),
+ m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height());
+}
+#endif
+
+} // namespace blink
« no previous file with comments | « Source/platform/graphics/paint/ClipDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698