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

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.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/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" 5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
6 6
7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h" 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/workers/WorkerGlobalScope.h" 10 #include "core/workers/WorkerGlobalScope.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 199 }
200 200
201 SkImageFilter* OffscreenCanvasRenderingContext2D::stateGetFilter() { 201 SkImageFilter* OffscreenCanvasRenderingContext2D::stateGetFilter() {
202 // TODO: make getFilter accept nullptr 202 // TODO: make getFilter accept nullptr
203 // return state().getFilter(nullptr, nullptr, IntSize(width(), height()), 203 // return state().getFilter(nullptr, nullptr, IntSize(width(), height()),
204 // this); 204 // this);
205 return nullptr; 205 return nullptr;
206 } 206 }
207 207
208 void OffscreenCanvasRenderingContext2D::validateStateStack() const { 208 void OffscreenCanvasRenderingContext2D::validateStateStack() const {
209 #if ENABLE(ASSERT) 209 #if DCHECK_IS_ON()
210 SkCanvas* skCanvas = existingDrawingCanvas(); 210 if (SkCanvas* skCanvas = existingDrawingCanvas()) {
211 if (skCanvas) { 211 DCHECK_EQ(static_cast<size_t>(skCanvas->getSaveCount()),
212 ASSERT(static_cast<size_t>(skCanvas->getSaveCount()) == 212 m_stateStack.size() + 1);
213 m_stateStack.size());
214 } 213 }
215 #endif 214 #endif
216 } 215 }
217 216
218 bool OffscreenCanvasRenderingContext2D::isContextLost() const { 217 bool OffscreenCanvasRenderingContext2D::isContextLost() const {
219 return false; 218 return false;
220 } 219 }
221 220
222 bool OffscreenCanvasRenderingContext2D::isPaintable() const { 221 bool OffscreenCanvasRenderingContext2D::isPaintable() const {
223 return this->imageBuffer(); 222 return this->imageBuffer();
224 } 223 }
225 } 224 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698