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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h

Issue 1995733005: Fix 2D canvas state persistency after OffscreenCanvas.transferToImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 6 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 #ifndef BaseRenderingContext2D_h 5 #ifndef BaseRenderingContext2D_h
6 #define BaseRenderingContext2D_h 6 #define BaseRenderingContext2D_h
7 7
8 #include "bindings/modules/v8/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElem entOrImageBitmap.h" 8 #include "bindings/modules/v8/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElem entOrImageBitmap.h"
9 #include "bindings/modules/v8/StringOrCanvasGradientOrCanvasPattern.h" 9 #include "bindings/modules/v8/StringOrCanvasGradientOrCanvasPattern.h"
10 #include "core/html/ImageData.h" 10 #include "core/html/ImageData.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 virtual bool stateHasFilter() = 0; 150 virtual bool stateHasFilter() = 0;
151 virtual SkImageFilter* stateGetFilter() = 0; 151 virtual SkImageFilter* stateGetFilter() = 0;
152 virtual void snapshotStateForFilter() = 0; 152 virtual void snapshotStateForFilter() = 0;
153 153
154 virtual void validateStateStack() = 0; 154 virtual void validateStateStack() = 0;
155 155
156 virtual bool hasAlpha() const = 0; 156 virtual bool hasAlpha() const = 0;
157 157
158 virtual bool isContextLost() const = 0; 158 virtual bool isContextLost() const = 0;
159 159
160 void restoreMatrixClipStack(SkCanvas*) const;
161
160 DECLARE_VIRTUAL_TRACE(); 162 DECLARE_VIRTUAL_TRACE();
161 163
162 protected: 164 protected:
163 BaseRenderingContext2D(); 165 BaseRenderingContext2D();
164 166
165 CanvasRenderingContext2DState& modifiableState(); 167 CanvasRenderingContext2DState& modifiableState();
166 const CanvasRenderingContext2DState& state() const { return *m_stateStack.la st(); } 168 const CanvasRenderingContext2DState& state() const { return *m_stateStack.la st(); }
167 169
168 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*); 170 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*);
169 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform edClipBounds, SkIRect*); 171 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform edClipBounds, SkIRect*);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 foregroundPaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); 286 foregroundPaint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
285 c->setMatrix(ctm); 287 c->setMatrix(ctm);
286 drawFunc(c, &foregroundPaint); 288 drawFunc(c, &foregroundPaint);
287 c->restore(); 289 c->restore();
288 c->setMatrix(ctm); 290 c->setMatrix(ctm);
289 } 291 }
290 292
291 } // namespace blink 293 } // namespace blink
292 294
293 #endif // BaseRenderingContext2D_h 295 #endif // BaseRenderingContext2D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698