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

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: 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 void restoreCurrentTexture2D(); 1032 void restoreCurrentTexture2D();
1033 1033
1034 void findNewMaxNonDefaultTextureUnit(); 1034 void findNewMaxNonDefaultTextureUnit();
1035 1035
1036 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName); 1036 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName);
1037 1037
1038 // Ensures that the JavaScript wrappers for objects that are 1038 // Ensures that the JavaScript wrappers for objects that are
1039 // latched into the context's state, or which are implicitly 1039 // latched into the context's state, or which are implicitly
1040 // linked together (like programs and their attached shaders), are 1040 // linked together (like programs and their attached shaders), are
1041 // not garbage collected before they should be. 1041 // not garbage collected before they should be.
1042 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, const char* baseName, unsigned long index, ScriptWrappable* targetObject); 1042 v8::Persistent<v8::Array> m_2DTextureWrappers;
1043 v8::Persistent<v8::Array> m_2DArrayTextureWrappers;
1044 v8::Persistent<v8::Array> m_3DTextureWrappers;
1045 v8::Persistent<v8::Array> m_cubeMapTextureWrappers;
1046 v8::Persistent<v8::Array> m_extensionWrappers;
haraken 2016/05/13 01:32:41 Would you help me understand why these persistent
Ken Russell (switch to Gerrit) 2016/05/13 01:45:35 I specifically made them weak to avoid possible le
1047
1048 // The "catch-all" array for the rest of the preserved object
1049 // wrappers. The enum below defines how the indices in this array
1050 // are used.
1051 enum PreservedWrapperIndex {
1052 PreservedArrayBuffer,
1053 PreservedElementArrayBuffer,
1054 PreservedFramebuffer,
1055 PreservedProgram,
1056 PreservedRenderbuffer,
1057 PreservedDefaultVAO,
1058 PreservedVAO,
1059 };
1060 v8::Persistent<v8::Array> m_miscWrappers;
1061
1062 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec t, v8::Local<v8::String> hiddenValueName, v8::Persistent<v8::Array>* persistentC ache, uint32_t index, ScriptWrappable* targetObject);
1063
1043 // Called to lazily instantiate the wrapper for the default VAO 1064 // Called to lazily instantiate the wrapper for the default VAO
1044 // during calls to bindBuffer and vertexAttribPointer (from 1065 // during calls to bindBuffer and vertexAttribPointer (from
1045 // JavaScript). 1066 // JavaScript).
1046 void maybePreserveDefaultVAOObjectWrapper(ScriptState*); 1067 void maybePreserveDefaultVAOObjectWrapper(ScriptState*);
1047 1068
1048 virtual bool transformFeedbackActive() const { return false; } 1069 virtual bool transformFeedbackActive() const { return false; }
1049 virtual bool transformFeedbackPaused() const { return false; } 1070 virtual bool transformFeedbackPaused() const { return false; }
1050 1071
1051 friend class WebGLStateRestorer; 1072 friend class WebGLStateRestorer;
1052 friend class WebGLRenderingContextEvictionManager; 1073 friend class WebGLRenderingContextEvictionManager;
(...skipping 19 matching lines...) Expand all
1072 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderOnWorke rThread(Platform::ContextAttributes, Platform::GraphicsInfo, ScriptState*); 1093 static PassOwnPtr<WebGraphicsContext3DProvider> createContextProviderOnWorke rThread(Platform::ContextAttributes, Platform::GraphicsInfo, ScriptState*);
1073 }; 1094 };
1074 1095
1075 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1096 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1076 1097
1077 } // namespace blink 1098 } // namespace blink
1078 1099
1079 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1100 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1080 1101
1081 #endif // WebGLRenderingContextBase_h 1102 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698