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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2508943003: Make OffscreenCanvas resizeable (Closed)
Patch Set: Created 4 years, 1 month 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/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 9cf2cb0c58f2294695b0d661e3f211a7b66dd9f8..f810b8c32aa1caab5b5a21a03788f29727f36d50 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -141,15 +141,6 @@ void CanvasRenderingContext2D::setCanvasGetContextResult(
result.setCanvasRenderingContext2D(this);
}
-void CanvasRenderingContext2D::unwindStateStack() {
- if (size_t stackSize = m_stateStack.size()) {
- if (SkCanvas* skCanvas = canvas()->existingDrawingCanvas()) {
- while (--stackSize)
- skCanvas->restore();
- }
- }
-}
-
CanvasRenderingContext2D::~CanvasRenderingContext2D() {}
void CanvasRenderingContext2D::dispose() {
@@ -280,25 +271,8 @@ void CanvasRenderingContext2D::dispatchContextRestoredEvent(TimerBase*) {
}
void CanvasRenderingContext2D::reset() {
- validateStateStack();
- unwindStateStack();
- m_stateStack.resize(1);
- m_stateStack.first() = CanvasRenderingContext2DState::create();
- m_path.clear();
- if (SkCanvas* c = canvas()->existingDrawingCanvas()) {
- // The canvas should always have an initial/unbalanced save frame, which
- // we use to reset the top level matrix and clip here.
- DCHECK_EQ(c->getSaveCount(), 2);
- c->restore();
- c->save();
- DCHECK(c->getTotalMatrix().isIdentity());
-#if DCHECK_IS_ON()
- SkIRect clipBounds;
- DCHECK(c->getClipDeviceBounds(&clipBounds));
- DCHECK(clipBounds == c->imageInfo().bounds());
-#endif
- }
- validateStateStack();
+ // This is a multiple inherritance bootstrap
+ BaseRenderingContext2D::reset();
}
void CanvasRenderingContext2D::restoreCanvasMatrixClipStack(SkCanvas* c) const {

Powered by Google App Engine
This is Rietveld 408576698