| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/canvas2d/ClipList.h" | 5 #include "modules/canvas2d/ClipList.h" |
| 6 | 6 |
| 7 #include "platform/transforms/AffineTransform.h" | 7 #include "platform/transforms/AffineTransform.h" |
| 8 #include "third_party/skia/include/core/SkCanvas.h" | 8 #include "third_party/skia/include/core/SkCanvas.h" |
| 9 #include "third_party/skia/include/pathops/SkPathOps.h" | 9 #include "third_party/skia/include/pathops/SkPathOps.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 if (m_clipList.isEmpty()) | 22 if (m_clipList.isEmpty()) |
| 23 m_currentClipPath = path; | 23 m_currentClipPath = path; |
| 24 else | 24 else |
| 25 Op(m_currentClipPath, path, SkPathOp::kIntersect_SkPathOp, | 25 Op(m_currentClipPath, path, SkPathOp::kIntersect_SkPathOp, |
| 26 &m_currentClipPath); | 26 &m_currentClipPath); |
| 27 m_clipList.append(newClip); | 27 m_clipList.append(newClip); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void ClipList::playback(SkCanvas* canvas) const { | 30 void ClipList::playback(SkCanvas* canvas) const { |
| 31 for (const ClipOp* it = m_clipList.begin(); it < m_clipList.end(); it++) { | 31 for (const ClipOp* it = m_clipList.begin(); it < m_clipList.end(); it++) { |
| 32 canvas->clipPath(it->m_path, kIntersect_SkClipOp, | 32 canvas->clipPath(it->m_path, SkClipOp::kIntersect, |
| 33 it->m_antiAliasingMode == AntiAliased); | 33 it->m_antiAliasingMode == AntiAliased); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 const SkPath& ClipList::getCurrentClipPath() const { | 37 const SkPath& ClipList::getCurrentClipPath() const { |
| 38 return m_currentClipPath; | 38 return m_currentClipPath; |
| 39 } | 39 } |
| 40 | 40 |
| 41 ClipList::ClipOp::ClipOp() : m_antiAliasingMode(AntiAliased) {} | 41 ClipList::ClipOp::ClipOp() : m_antiAliasingMode(AntiAliased) {} |
| 42 | 42 |
| 43 ClipList::ClipOp::ClipOp(const ClipOp& other) | 43 ClipList::ClipOp::ClipOp(const ClipOp& other) |
| 44 : m_path(other.m_path), m_antiAliasingMode(other.m_antiAliasingMode) {} | 44 : m_path(other.m_path), m_antiAliasingMode(other.m_antiAliasingMode) {} |
| 45 | 45 |
| 46 } // namespace blink | 46 } // namespace blink |
| OLD | NEW |