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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp

Issue 2391373002: Refactor CRC2D::reset() to avoid non-additive SkCanvas state operations (Closed)
Patch Set: review Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698