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

Unified Diff: Source/core/html/canvas/ClipList.cpp

Issue 895153002: Make CanvasRenderingContext2D use SkCanvas directly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix issue with the copy composite operator Created 5 years, 10 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 | « Source/core/html/canvas/ClipList.h ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/ClipList.cpp
diff --git a/Source/core/html/canvas/ClipList.cpp b/Source/core/html/canvas/ClipList.cpp
index 403ed7450523f57293078ea57be6617b4c4582df..a3a4883cf076cfe6ee39fdfd1455ae33db52aea9 100644
--- a/Source/core/html/canvas/ClipList.cpp
+++ b/Source/core/html/canvas/ClipList.cpp
@@ -6,40 +6,36 @@
#include "core/html/canvas/ClipList.h"
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/Path.h"
#include "platform/transforms/AffineTransform.h"
+#include "third_party/skia/include/core/SkCanvas.h"
namespace blink {
ClipList::ClipList(const ClipList& other) : m_clipList(other.m_clipList) { }
-void ClipList::clipPath(const Path& path, WindRule windRule, AntiAliasingMode antiAliasingMode, const AffineTransform& ctm)
+void ClipList::clipPath(const SkPath& path, AntiAliasingMode antiAliasingMode, const SkMatrix& ctm)
{
ClipOp newClip;
newClip.m_antiAliasingMode = antiAliasingMode;
- newClip.m_windRule = windRule;
newClip.m_path = path;
newClip.m_path.transform(ctm);
m_clipList.append(newClip);
}
-void ClipList::playback(GraphicsContext* context) const
+void ClipList::playback(SkCanvas* canvas) const
{
for (const ClipOp* it = m_clipList.begin(); it < m_clipList.end(); it++) {
- context->clipPath(it->m_path, it->m_windRule, it->m_antiAliasingMode);
+ canvas->clipPath(it->m_path, SkRegion::kIntersect_Op, it->m_antiAliasingMode == AntiAliased);
}
}
ClipList::ClipOp::ClipOp()
: m_antiAliasingMode(AntiAliased)
- , m_windRule(RULE_NONZERO)
{ }
ClipList::ClipOp::ClipOp(const ClipOp& other)
: m_path(other.m_path)
, m_antiAliasingMode(other.m_antiAliasingMode)
- , m_windRule(other.m_windRule)
{ }
} // namespace blink
« no previous file with comments | « Source/core/html/canvas/ClipList.h ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698