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

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp

Issue 2778483002: Synchronize commits at end of JS task (Closed)
Patch Set: remove m_overdrawframe Created 3 years, 9 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 bool OffscreenCanvasRenderingContext2D::hasImageBuffer() const { 99 bool OffscreenCanvasRenderingContext2D::hasImageBuffer() const {
100 return !!m_imageBuffer; 100 return !!m_imageBuffer;
101 } 101 }
102 102
103 void OffscreenCanvasRenderingContext2D::reset() { 103 void OffscreenCanvasRenderingContext2D::reset() {
104 m_imageBuffer = nullptr; 104 m_imageBuffer = nullptr;
105 BaseRenderingContext2D::reset(); 105 BaseRenderingContext2D::reset();
106 } 106 }
107 107
108 void OffscreenCanvasRenderingContext2D::finalizeFrame() {
109 DCHECK(offscreenCanvas());
110 offscreenCanvas()->doCommitAtEndOfTask();
111 }
112
108 ColorBehavior OffscreenCanvasRenderingContext2D::drawImageColorBehavior() 113 ColorBehavior OffscreenCanvasRenderingContext2D::drawImageColorBehavior()
109 const { 114 const {
110 return CanvasRenderingContext::colorBehaviorForMediaDrawnToCanvas(); 115 return CanvasRenderingContext::colorBehaviorForMediaDrawnToCanvas();
111 } 116 }
112 117
113 ImageBuffer* OffscreenCanvasRenderingContext2D::imageBuffer() const { 118 ImageBuffer* OffscreenCanvasRenderingContext2D::imageBuffer() const {
114 if (!m_imageBuffer) { 119 if (!m_imageBuffer) {
115 IntSize surfaceSize(width(), height()); 120 IntSize surfaceSize(width(), height());
116 OpacityMode opacityMode = hasAlpha() ? NonOpaque : Opaque; 121 OpacityMode opacityMode = hasAlpha() ? NonOpaque : Opaque;
117 std::unique_ptr<ImageBufferSurface> surface; 122 std::unique_ptr<ImageBufferSurface> surface;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 250 }
246 251
247 bool OffscreenCanvasRenderingContext2D::isContextLost() const { 252 bool OffscreenCanvasRenderingContext2D::isContextLost() const {
248 return false; 253 return false;
249 } 254 }
250 255
251 bool OffscreenCanvasRenderingContext2D::isPaintable() const { 256 bool OffscreenCanvasRenderingContext2D::isPaintable() const {
252 return this->imageBuffer(); 257 return this->imageBuffer();
253 } 258 }
254 } 259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698