OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/csspaint/PaintRenderingContext2D.h" | 5 #include "modules/csspaint/PaintRenderingContext2D.h" |
6 | 6 |
7 #include "platform/graphics/ImageBuffer.h" | 7 #include "platform/graphics/ImageBuffer.h" |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 ASSERT(m_imageBuffer); | 60 ASSERT(m_imageBuffer); |
61 return m_imageBuffer->baseTransform(); | 61 return m_imageBuffer->baseTransform(); |
62 } | 62 } |
63 | 63 |
64 void PaintRenderingContext2D::didDraw(const SkIRect& dirtyRect) { | 64 void PaintRenderingContext2D::didDraw(const SkIRect& dirtyRect) { |
65 ASSERT(m_imageBuffer); | 65 ASSERT(m_imageBuffer); |
66 return m_imageBuffer->didDraw(SkRect::Make(dirtyRect)); | 66 return m_imageBuffer->didDraw(SkRect::Make(dirtyRect)); |
67 } | 67 } |
68 | 68 |
69 void PaintRenderingContext2D::validateStateStack() const { | 69 void PaintRenderingContext2D::validateStateStack() const { |
70 #if ENABLE(ASSERT) | 70 #if DCHECK_IS_ON() |
71 SkCanvas* skCanvas = existingDrawingCanvas(); | 71 if (SkCanvas* skCanvas = existingDrawingCanvas()) { |
72 if (skCanvas) { | 72 DCHECK_EQ(static_cast<size_t>(skCanvas->getSaveCount()), |
73 ASSERT(static_cast<size_t>(skCanvas->getSaveCount()) == | 73 m_stateStack.size() + 1); |
74 m_stateStack.size()); | |
75 } | 74 } |
76 #endif | 75 #endif |
77 } | 76 } |
78 | 77 |
79 } // namespace blink | 78 } // namespace blink |
OLD | NEW |