/src/3rdparty/webkit/Source/WebCore/generated/JSOESStandardDerivatives.cpp

https://bitbucket.org/ultra_iter/qt-vtl · C++ · 125 lines · 79 code · 25 blank · 21 comment · 2 complexity · 3f9f40d70ddd536ae9930bef69140f6f MD5 · raw file

  1. /*
  2. This file is part of the WebKit open source project.
  3. This file has been generated by generate-bindings.pl. DO NOT MODIFY!
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #include "config.h"
  18. #if ENABLE(WEBGL)
  19. #include "JSOESStandardDerivatives.h"
  20. #include "OESStandardDerivatives.h"
  21. #include <wtf/GetPtr.h>
  22. using namespace JSC;
  23. namespace WebCore {
  24. ASSERT_CLASS_FITS_IN_CELL(JSOESStandardDerivatives);
  25. /* Hash table for prototype */
  26. #if ENABLE(JIT)
  27. #define THUNK_GENERATOR(generator) , generator
  28. #else
  29. #define THUNK_GENERATOR(generator)
  30. #endif
  31. static const HashTableValue JSOESStandardDerivativesPrototypeTableValues[2] =
  32. {
  33. { "FRAGMENT_SHADER_DERIVATIVE_HINT_OES", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOESStandardDerivativesFRAGMENT_SHADER_DERIVATIVE_HINT_OES), (intptr_t)0 THUNK_GENERATOR(0) },
  34. { 0, 0, 0, 0 THUNK_GENERATOR(0) }
  35. };
  36. #undef THUNK_GENERATOR
  37. static JSC_CONST_HASHTABLE HashTable JSOESStandardDerivativesPrototypeTable = { 2, 1, JSOESStandardDerivativesPrototypeTableValues, 0 };
  38. const ClassInfo JSOESStandardDerivativesPrototype::s_info = { "OESStandardDerivativesPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSOESStandardDerivativesPrototypeTable, 0 };
  39. JSObject* JSOESStandardDerivativesPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
  40. {
  41. return getDOMPrototype<JSOESStandardDerivatives>(exec, globalObject);
  42. }
  43. bool JSOESStandardDerivativesPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
  44. {
  45. return getStaticValueSlot<JSOESStandardDerivativesPrototype, JSObject>(exec, &JSOESStandardDerivativesPrototypeTable, this, propertyName, slot);
  46. }
  47. bool JSOESStandardDerivativesPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
  48. {
  49. return getStaticValueDescriptor<JSOESStandardDerivativesPrototype, JSObject>(exec, &JSOESStandardDerivativesPrototypeTable, this, propertyName, descriptor);
  50. }
  51. const ClassInfo JSOESStandardDerivatives::s_info = { "OESStandardDerivatives", &JSDOMWrapper::s_info, 0, 0 };
  52. JSOESStandardDerivatives::JSOESStandardDerivatives(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<OESStandardDerivatives> impl)
  53. : JSDOMWrapper(structure, globalObject)
  54. , m_impl(impl)
  55. {
  56. ASSERT(inherits(&s_info));
  57. }
  58. JSObject* JSOESStandardDerivatives::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
  59. {
  60. return new (exec) JSOESStandardDerivativesPrototype(exec->globalData(), globalObject, JSOESStandardDerivativesPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
  61. }
  62. // Constant getters
  63. JSValue jsOESStandardDerivativesFRAGMENT_SHADER_DERIVATIVE_HINT_OES(ExecState* exec, JSValue, const Identifier&)
  64. {
  65. UNUSED_PARAM(exec);
  66. return jsNumber(static_cast<int>(0x8B8B));
  67. }
  68. static inline bool isObservable(JSOESStandardDerivatives* jsOESStandardDerivatives)
  69. {
  70. if (jsOESStandardDerivatives->hasCustomProperties())
  71. return true;
  72. return false;
  73. }
  74. bool JSOESStandardDerivativesOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
  75. {
  76. JSOESStandardDerivatives* jsOESStandardDerivatives = static_cast<JSOESStandardDerivatives*>(handle.get().asCell());
  77. if (!isObservable(jsOESStandardDerivatives))
  78. return false;
  79. WebGLRenderingContext* root = jsOESStandardDerivatives->impl()->context();
  80. return visitor.containsOpaqueRoot(root);
  81. }
  82. void JSOESStandardDerivativesOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
  83. {
  84. JSOESStandardDerivatives* jsOESStandardDerivatives = static_cast<JSOESStandardDerivatives*>(handle.get().asCell());
  85. DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
  86. uncacheWrapper(world, jsOESStandardDerivatives->impl(), jsOESStandardDerivatives);
  87. }
  88. JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, OESStandardDerivatives* impl)
  89. {
  90. return wrap<JSOESStandardDerivatives>(exec, globalObject, impl);
  91. }
  92. OESStandardDerivatives* toOESStandardDerivatives(JSC::JSValue value)
  93. {
  94. return value.inherits(&JSOESStandardDerivatives::s_info) ? static_cast<JSOESStandardDerivatives*>(asObject(value))->impl() : 0;
  95. }
  96. }
  97. #endif // ENABLE(WEBGL)