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

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

Issue 1919363002: Add createGradient and createPattern to OffscreenCanvas2D in worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/UnionTypesModules.h" 7 #include "bindings/modules/v8/UnionTypesModules.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "platform/graphics/ImageBuffer.h" 9 #include "platform/graphics/ImageBuffer.h"
10 #include "platform/graphics/StaticBitmapImage.h" 10 #include "platform/graphics/StaticBitmapImage.h"
(...skipping 25 matching lines...) Expand all
36 return m_originClean; 36 return m_originClean;
37 } 37 }
38 38
39 void OffscreenCanvasRenderingContext2D::setOriginTainted() 39 void OffscreenCanvasRenderingContext2D::setOriginTainted()
40 { 40 {
41 m_originClean = false; 41 m_originClean = false;
42 } 42 }
43 43
44 bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* sour ce) 44 bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* sour ce)
45 { 45 {
46 if (ScriptState::current(v8::Isolate::GetCurrent())->getExecutionContext()-> isWorkerGlobalScope()) {
47 // Currently, we only support passing in ImageBitmap as source image in
48 // drawImage() or createPattern() in a OffscreenCanvas2d in worker.
49 ASSERT(source->isImageBitmap());
50 // ImageBitmap wouldTaintOrigin doesn't consider destinationSecurityOrig in.
51 return source->wouldTaintOrigin(nullptr);
52 }
53
54 // TODO(xlai): implement wouldTaintOrigin for OffscreenCanvas2d on main thre ad
Justin Novosad 2016/04/26 19:50:07 This comment should refer to a crbug
46 NOTIMPLEMENTED(); 55 NOTIMPLEMENTED();
47 return false; 56 return true;
48 } 57 }
49 58
50 int OffscreenCanvasRenderingContext2D::width() const 59 int OffscreenCanvasRenderingContext2D::width() const
51 { 60 {
52 return getOffscreenCanvas()->width(); 61 return getOffscreenCanvas()->width();
53 } 62 }
54 63
55 int OffscreenCanvasRenderingContext2D::height() const 64 int OffscreenCanvasRenderingContext2D::height() const
56 { 65 {
57 return getOffscreenCanvas()->height(); 66 return getOffscreenCanvas()->height();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 150 }
142 #endif 151 #endif
143 } 152 }
144 153
145 bool OffscreenCanvasRenderingContext2D::isContextLost() const 154 bool OffscreenCanvasRenderingContext2D::isContextLost() const
146 { 155 {
147 return false; 156 return false;
148 } 157 }
149 158
150 } 159 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698