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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 1983953002: Replace uses of v8::Persistent with ScopedPersistent. (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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef WebGLRenderingContextBase_h 26 #ifndef WebGLRenderingContextBase_h
27 #define WebGLRenderingContextBase_h 27 #define WebGLRenderingContextBase_h
28 28
29 #include "bindings/core/v8/Nullable.h" 29 #include "bindings/core/v8/Nullable.h"
30 #include "bindings/core/v8/ScopedPersistent.h"
30 #include "bindings/core/v8/ScriptState.h" 31 #include "bindings/core/v8/ScriptState.h"
31 #include "bindings/core/v8/ScriptValue.h" 32 #include "bindings/core/v8/ScriptValue.h"
32 #include "bindings/core/v8/ScriptWrappable.h" 33 #include "bindings/core/v8/ScriptWrappable.h"
33 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
34 #include "core/dom/DOMTypedArray.h" 35 #include "core/dom/DOMTypedArray.h"
35 #include "core/dom/TypedFlexibleArrayBufferView.h" 36 #include "core/dom/TypedFlexibleArrayBufferView.h"
36 #include "core/html/canvas/CanvasRenderingContext.h" 37 #include "core/html/canvas/CanvasRenderingContext.h"
37 #include "core/layout/LayoutBoxModelObject.h" 38 #include "core/layout/LayoutBoxModelObject.h"
38 #include "modules/webgl/WebGLContextAttributes.h" 39 #include "modules/webgl/WebGLContextAttributes.h"
39 #include "modules/webgl/WebGLExtensionName.h" 40 #include "modules/webgl/WebGLExtensionName.h"
40 #include "modules/webgl/WebGLObject.h"
41 #include "modules/webgl/WebGLTexture.h" 41 #include "modules/webgl/WebGLTexture.h"
42 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 42 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
43 #include "platform/Timer.h" 43 #include "platform/Timer.h"
44 #include "platform/graphics/ImageBuffer.h" 44 #include "platform/graphics/ImageBuffer.h"
45 #include "platform/graphics/gpu/DrawingBuffer.h" 45 #include "platform/graphics/gpu/DrawingBuffer.h"
46 #include "platform/graphics/gpu/Extensions3DUtil.h" 46 #include "platform/graphics/gpu/Extensions3DUtil.h"
47 #include "platform/graphics/gpu/WebGLImageConversion.h" 47 #include "platform/graphics/gpu/WebGLImageConversion.h"
48 #include "public/platform/Platform.h" 48 #include "public/platform/Platform.h"
49 #include "public/platform/WebGraphicsContext3DProvider.h" 49 #include "public/platform/WebGraphicsContext3DProvider.h"
50 #include "third_party/khronos/GLES2/gl2.h" 50 #include "third_party/khronos/GLES2/gl2.h"
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 void restoreCurrentTexture2D(); 1033 void restoreCurrentTexture2D();
1034 1034
1035 void findNewMaxNonDefaultTextureUnit(); 1035 void findNewMaxNonDefaultTextureUnit();
1036 1036
1037 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName); 1037 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName);
1038 1038
1039 // Ensures that the JavaScript wrappers for objects that are 1039 // Ensures that the JavaScript wrappers for objects that are
1040 // latched into the context's state, or which are implicitly 1040 // latched into the context's state, or which are implicitly
1041 // linked together (like programs and their attached shaders), are 1041 // linked together (like programs and their attached shaders), are
1042 // not garbage collected before they should be. 1042 // not garbage collected before they should be.
1043 V8CopyablePersistent<v8::Array> m_2DTextureWrappers; 1043 ScopedPersistent<v8::Array> m_2DTextureWrappers;
1044 V8CopyablePersistent<v8::Array> m_2DArrayTextureWrappers; 1044 ScopedPersistent<v8::Array> m_2DArrayTextureWrappers;
1045 V8CopyablePersistent<v8::Array> m_3DTextureWrappers; 1045 ScopedPersistent<v8::Array> m_3DTextureWrappers;
1046 V8CopyablePersistent<v8::Array> m_cubeMapTextureWrappers; 1046 ScopedPersistent<v8::Array> m_cubeMapTextureWrappers;
1047 V8CopyablePersistent<v8::Array> m_extensionWrappers; 1047 ScopedPersistent<v8::Array> m_extensionWrappers;
1048 1048
1049 // The "catch-all" array for the rest of the preserved object 1049 // The "catch-all" array for the rest of the preserved object
1050 // wrappers. The enum below defines how the indices in this array 1050 // wrappers. The enum below defines how the indices in this array
1051 // are used. 1051 // are used.
1052 enum PreservedWrapperIndex { 1052 enum PreservedWrapperIndex {
1053 PreservedArrayBuffer, 1053 PreservedArrayBuffer,
1054 PreservedElementArrayBuffer, 1054 PreservedElementArrayBuffer,
1055 PreservedFramebuffer, 1055 PreservedFramebuffer,
1056 PreservedProgram, 1056 PreservedProgram,
1057 PreservedRenderbuffer, 1057 PreservedRenderbuffer,
1058 PreservedDefaultVAO, 1058 PreservedDefaultVAO,
1059 PreservedVAO, 1059 PreservedVAO,
1060 }; 1060 };
1061 V8CopyablePersistent<v8::Array> m_miscWrappers; 1061 ScopedPersistent<v8::Array> m_miscWrappers;
1062 1062
1063 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, v8::Local<v8::String> hiddenValueName, V8CopyablePersistent<v8::Array>* persi stentCache, uint32_t index, ScriptWrappable* targetObject); 1063 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, v8::Local<v8::String> hiddenValueName, ScopedPersistent<v8::Array>* persisten tCache, uint32_t index, ScriptWrappable* targetObject);
1064 1064
1065 // Called to lazily instantiate the wrapper for the default VAO 1065 // Called to lazily instantiate the wrapper for the default VAO
1066 // during calls to bindBuffer and vertexAttribPointer (from 1066 // during calls to bindBuffer and vertexAttribPointer (from
1067 // JavaScript). 1067 // JavaScript).
1068 void maybePreserveDefaultVAOObjectWrapper(ScriptState*); 1068 void maybePreserveDefaultVAOObjectWrapper(ScriptState*);
1069 1069
1070 virtual bool transformFeedbackActive() const { return false; } 1070 virtual bool transformFeedbackActive() const { return false; }
1071 virtual bool transformFeedbackPaused() const { return false; } 1071 virtual bool transformFeedbackPaused() const { return false; }
1072 1072
1073 friend class WebGLStateRestorer; 1073 friend class WebGLStateRestorer;
(...skipping 20 matching lines...) Expand all
1094 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderOnWorke rThread(Platform::ContextAttributes, Platform::GraphicsInfo, ScriptState*); 1094 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderOnWorke rThread(Platform::ContextAttributes, Platform::GraphicsInfo, ScriptState*);
1095 }; 1095 };
1096 1096
1097 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1097 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1098 1098
1099 } // namespace blink 1099 } // namespace blink
1100 1100
1101 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1101 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1102 1102
1103 #endif // WebGLRenderingContextBase_h 1103 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698