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

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

Issue 1974713003: Speed up fix for expando-loss conformance test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add V8CopyablePersistent alias to avoid incorrect usage. 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
(...skipping 19 matching lines...) Expand all
30 #include "bindings/core/v8/ScriptState.h" 30 #include "bindings/core/v8/ScriptState.h"
31 #include "bindings/core/v8/ScriptValue.h" 31 #include "bindings/core/v8/ScriptValue.h"
32 #include "bindings/core/v8/ScriptWrappable.h" 32 #include "bindings/core/v8/ScriptWrappable.h"
33 #include "core/CoreExport.h" 33 #include "core/CoreExport.h"
34 #include "core/dom/DOMTypedArray.h" 34 #include "core/dom/DOMTypedArray.h"
35 #include "core/dom/TypedFlexibleArrayBufferView.h" 35 #include "core/dom/TypedFlexibleArrayBufferView.h"
36 #include "core/html/canvas/CanvasRenderingContext.h" 36 #include "core/html/canvas/CanvasRenderingContext.h"
37 #include "core/layout/LayoutBoxModelObject.h" 37 #include "core/layout/LayoutBoxModelObject.h"
38 #include "modules/webgl/WebGLContextAttributes.h" 38 #include "modules/webgl/WebGLContextAttributes.h"
39 #include "modules/webgl/WebGLExtensionName.h" 39 #include "modules/webgl/WebGLExtensionName.h"
40 #include "modules/webgl/WebGLObject.h"
40 #include "modules/webgl/WebGLTexture.h" 41 #include "modules/webgl/WebGLTexture.h"
41 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 42 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
42 #include "platform/Timer.h" 43 #include "platform/Timer.h"
43 #include "platform/graphics/ImageBuffer.h" 44 #include "platform/graphics/ImageBuffer.h"
44 #include "platform/graphics/gpu/DrawingBuffer.h" 45 #include "platform/graphics/gpu/DrawingBuffer.h"
45 #include "platform/graphics/gpu/Extensions3DUtil.h" 46 #include "platform/graphics/gpu/Extensions3DUtil.h"
46 #include "platform/graphics/gpu/WebGLImageConversion.h" 47 #include "platform/graphics/gpu/WebGLImageConversion.h"
47 #include "public/platform/Platform.h" 48 #include "public/platform/Platform.h"
48 #include "public/platform/WebGraphicsContext3DProvider.h" 49 #include "public/platform/WebGraphicsContext3DProvider.h"
49 #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
1032 void restoreCurrentTexture2D(); 1033 void restoreCurrentTexture2D();
1033 1034
1034 void findNewMaxNonDefaultTextureUnit(); 1035 void findNewMaxNonDefaultTextureUnit();
1035 1036
1036 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);
1037 1038
1038 // Ensures that the JavaScript wrappers for objects that are 1039 // Ensures that the JavaScript wrappers for objects that are
1039 // latched into the context's state, or which are implicitly 1040 // latched into the context's state, or which are implicitly
1040 // linked together (like programs and their attached shaders), are 1041 // linked together (like programs and their attached shaders), are
1041 // not garbage collected before they should be. 1042 // not garbage collected before they should be.
1042 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, const char* baseName, unsigned long index, ScriptWrappable* targetObject); 1043 V8CopyablePersistent<v8::Array> m_2DTextureWrappers;
1044 V8CopyablePersistent<v8::Array> m_2DArrayTextureWrappers;
1045 V8CopyablePersistent<v8::Array> m_3DTextureWrappers;
1046 V8CopyablePersistent<v8::Array> m_cubeMapTextureWrappers;
1047 V8CopyablePersistent<v8::Array> m_extensionWrappers;
1048
1049 // The "catch-all" array for the rest of the preserved object
1050 // wrappers. The enum below defines how the indices in this array
1051 // are used.
1052 enum PreservedWrapperIndex {
1053 PreservedArrayBuffer,
1054 PreservedElementArrayBuffer,
1055 PreservedFramebuffer,
1056 PreservedProgram,
1057 PreservedRenderbuffer,
1058 PreservedDefaultVAO,
1059 PreservedVAO,
1060 };
1061 V8CopyablePersistent<v8::Array> m_miscWrappers;
1062
1063 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, v8::Local<v8::String> hiddenValueName, V8CopyablePersistent<v8::Array>* persi stentCache, uint32_t index, ScriptWrappable* targetObject);
1064
1043 // Called to lazily instantiate the wrapper for the default VAO 1065 // Called to lazily instantiate the wrapper for the default VAO
1044 // during calls to bindBuffer and vertexAttribPointer (from 1066 // during calls to bindBuffer and vertexAttribPointer (from
1045 // JavaScript). 1067 // JavaScript).
1046 void maybePreserveDefaultVAOObjectWrapper(ScriptState*); 1068 void maybePreserveDefaultVAOObjectWrapper(ScriptState*);
1047 1069
1048 virtual bool transformFeedbackActive() const { return false; } 1070 virtual bool transformFeedbackActive() const { return false; }
1049 virtual bool transformFeedbackPaused() const { return false; } 1071 virtual bool transformFeedbackPaused() const { return false; }
1050 1072
1051 friend class WebGLStateRestorer; 1073 friend class WebGLStateRestorer;
1052 friend class WebGLRenderingContextEvictionManager; 1074 friend class WebGLRenderingContextEvictionManager;
(...skipping 19 matching lines...) Expand all
1072 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderOnWorke rThread(Platform::ContextAttributes, Platform::GraphicsInfo, ScriptState*); 1094 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderOnWorke rThread(Platform::ContextAttributes, Platform::GraphicsInfo, ScriptState*);
1073 }; 1095 };
1074 1096
1075 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1097 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1076 1098
1077 } // namespace blink 1099 } // namespace blink
1078 1100
1079 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);
1080 1102
1081 #endif // WebGLRenderingContextBase_h 1103 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698