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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp

Issue 2391373002: Refactor CRC2D::reset() to avoid non-additive SkCanvas state operations (Closed)
Patch Set: unit test fix 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
index 15e5a6aa9311f1f065211ab1a6e65d5168f57378..808ce86ba67fe70d88bbe3a8fef9273751fb4f57 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
@@ -68,10 +68,9 @@ void PaintRenderingContext2D::didDraw(const SkIRect& dirtyRect) {
void PaintRenderingContext2D::validateStateStack() const {
#if ENABLE(ASSERT)
Justin Novosad 2016/10/06 19:48:54 DCHECK_IS_ON()
f(malita) 2016/10/06 20:02:29 Done.
- SkCanvas* skCanvas = existingDrawingCanvas();
- if (skCanvas) {
- ASSERT(static_cast<size_t>(skCanvas->getSaveCount()) ==
- m_stateStack.size());
+ if (SkCanvas* skCanvas = existingDrawingCanvas()) {
+ DCHECK_EQ(static_cast<size_t>(skCanvas->getSaveCount()),
+ m_stateStack.size() + 1);
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698