/qtwebkit-2.2.2-source/Source/WebCore/platform/graphics/GraphicsContext3D.h

# · C++ Header · 940 lines · 738 code · 81 blank · 121 comment · 14 complexity · 0d4c76b8ab536776ca980f8b2631eeb7 MD5 · raw file

  1. /*
  2. * Copyright (C) 2009 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  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.
  24. */
  25. #ifndef GraphicsContext3D_h
  26. #define GraphicsContext3D_h
  27. #include "IntSize.h"
  28. #include "GraphicsLayer.h"
  29. #include "GraphicsTypes3D.h"
  30. #include "PlatformString.h"
  31. #include <wtf/HashMap.h>
  32. #include <wtf/ListHashSet.h>
  33. #include <wtf/Noncopyable.h>
  34. // FIXME: Find a better way to avoid the name confliction for NO_ERROR.
  35. #if ((PLATFORM(CHROMIUM) && OS(WINDOWS)) || PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)))
  36. #undef NO_ERROR
  37. #elif PLATFORM(GTK)
  38. // This define is from the X11 headers, but it's used below, so we must undefine it.
  39. #undef VERSION
  40. #endif
  41. #if PLATFORM(MAC) || PLATFORM(GTK)
  42. #include "ANGLEWebKitBridge.h"
  43. #endif
  44. #if PLATFORM(MAC)
  45. #include <OpenGL/OpenGL.h>
  46. #include <wtf/RetainPtr.h>
  47. #ifdef __OBJC__
  48. @class CALayer;
  49. @class WebGLLayer;
  50. #else
  51. class CALayer;
  52. class WebGLLayer;
  53. #endif
  54. #elif PLATFORM(QT)
  55. QT_BEGIN_NAMESPACE
  56. class QPainter;
  57. class QRect;
  58. QT_END_NAMESPACE
  59. #elif PLATFORM(GTK)
  60. typedef unsigned int GLuint;
  61. #endif
  62. #if PLATFORM(MAC)
  63. typedef CGLContextObj PlatformGraphicsContext3D;
  64. #else
  65. typedef void* PlatformGraphicsContext3D;
  66. #endif
  67. // These are currently the same among all implementations.
  68. const PlatformGraphicsContext3D NullPlatformGraphicsContext3D = 0;
  69. const Platform3DObject NullPlatform3DObject = 0;
  70. #if USE(CG)
  71. #include <CoreGraphics/CGContext.h>
  72. #endif
  73. namespace WebCore {
  74. class CanvasRenderingContext;
  75. class DrawingBuffer;
  76. class Extensions3D;
  77. #if PLATFORM(MAC) || PLATFORM(GTK)
  78. class Extensions3DOpenGL;
  79. #endif
  80. class HostWindow;
  81. class Image;
  82. class ImageData;
  83. #if USE(CAIRO)
  84. class PlatformContextCairo;
  85. #endif
  86. struct ActiveInfo {
  87. String name;
  88. GC3Denum type;
  89. GC3Dint size;
  90. };
  91. // FIXME: ideally this would be used on all platforms.
  92. #if PLATFORM(CHROMIUM) || PLATFORM(QT) || PLATFORM(GTK)
  93. class GraphicsContext3DInternal;
  94. #endif
  95. class GraphicsContext3D : public RefCounted<GraphicsContext3D> {
  96. public:
  97. enum {
  98. DEPTH_BUFFER_BIT = 0x00000100,
  99. STENCIL_BUFFER_BIT = 0x00000400,
  100. COLOR_BUFFER_BIT = 0x00004000,
  101. POINTS = 0x0000,
  102. LINES = 0x0001,
  103. LINE_LOOP = 0x0002,
  104. LINE_STRIP = 0x0003,
  105. TRIANGLES = 0x0004,
  106. TRIANGLE_STRIP = 0x0005,
  107. TRIANGLE_FAN = 0x0006,
  108. ZERO = 0,
  109. ONE = 1,
  110. SRC_COLOR = 0x0300,
  111. ONE_MINUS_SRC_COLOR = 0x0301,
  112. SRC_ALPHA = 0x0302,
  113. ONE_MINUS_SRC_ALPHA = 0x0303,
  114. DST_ALPHA = 0x0304,
  115. ONE_MINUS_DST_ALPHA = 0x0305,
  116. DST_COLOR = 0x0306,
  117. ONE_MINUS_DST_COLOR = 0x0307,
  118. SRC_ALPHA_SATURATE = 0x0308,
  119. FUNC_ADD = 0x8006,
  120. BLEND_EQUATION = 0x8009,
  121. BLEND_EQUATION_RGB = 0x8009,
  122. BLEND_EQUATION_ALPHA = 0x883D,
  123. FUNC_SUBTRACT = 0x800A,
  124. FUNC_REVERSE_SUBTRACT = 0x800B,
  125. BLEND_DST_RGB = 0x80C8,
  126. BLEND_SRC_RGB = 0x80C9,
  127. BLEND_DST_ALPHA = 0x80CA,
  128. BLEND_SRC_ALPHA = 0x80CB,
  129. CONSTANT_COLOR = 0x8001,
  130. ONE_MINUS_CONSTANT_COLOR = 0x8002,
  131. CONSTANT_ALPHA = 0x8003,
  132. ONE_MINUS_CONSTANT_ALPHA = 0x8004,
  133. BLEND_COLOR = 0x8005,
  134. ARRAY_BUFFER = 0x8892,
  135. ELEMENT_ARRAY_BUFFER = 0x8893,
  136. ARRAY_BUFFER_BINDING = 0x8894,
  137. ELEMENT_ARRAY_BUFFER_BINDING = 0x8895,
  138. STREAM_DRAW = 0x88E0,
  139. STATIC_DRAW = 0x88E4,
  140. DYNAMIC_DRAW = 0x88E8,
  141. BUFFER_SIZE = 0x8764,
  142. BUFFER_USAGE = 0x8765,
  143. CURRENT_VERTEX_ATTRIB = 0x8626,
  144. FRONT = 0x0404,
  145. BACK = 0x0405,
  146. FRONT_AND_BACK = 0x0408,
  147. TEXTURE_2D = 0x0DE1,
  148. CULL_FACE = 0x0B44,
  149. BLEND = 0x0BE2,
  150. DITHER = 0x0BD0,
  151. STENCIL_TEST = 0x0B90,
  152. DEPTH_TEST = 0x0B71,
  153. SCISSOR_TEST = 0x0C11,
  154. POLYGON_OFFSET_FILL = 0x8037,
  155. SAMPLE_ALPHA_TO_COVERAGE = 0x809E,
  156. SAMPLE_COVERAGE = 0x80A0,
  157. NO_ERROR = 0,
  158. INVALID_ENUM = 0x0500,
  159. INVALID_VALUE = 0x0501,
  160. INVALID_OPERATION = 0x0502,
  161. OUT_OF_MEMORY = 0x0505,
  162. CW = 0x0900,
  163. CCW = 0x0901,
  164. LINE_WIDTH = 0x0B21,
  165. ALIASED_POINT_SIZE_RANGE = 0x846D,
  166. ALIASED_LINE_WIDTH_RANGE = 0x846E,
  167. CULL_FACE_MODE = 0x0B45,
  168. FRONT_FACE = 0x0B46,
  169. DEPTH_RANGE = 0x0B70,
  170. DEPTH_WRITEMASK = 0x0B72,
  171. DEPTH_CLEAR_VALUE = 0x0B73,
  172. DEPTH_FUNC = 0x0B74,
  173. STENCIL_CLEAR_VALUE = 0x0B91,
  174. STENCIL_FUNC = 0x0B92,
  175. STENCIL_FAIL = 0x0B94,
  176. STENCIL_PASS_DEPTH_FAIL = 0x0B95,
  177. STENCIL_PASS_DEPTH_PASS = 0x0B96,
  178. STENCIL_REF = 0x0B97,
  179. STENCIL_VALUE_MASK = 0x0B93,
  180. STENCIL_WRITEMASK = 0x0B98,
  181. STENCIL_BACK_FUNC = 0x8800,
  182. STENCIL_BACK_FAIL = 0x8801,
  183. STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802,
  184. STENCIL_BACK_PASS_DEPTH_PASS = 0x8803,
  185. STENCIL_BACK_REF = 0x8CA3,
  186. STENCIL_BACK_VALUE_MASK = 0x8CA4,
  187. STENCIL_BACK_WRITEMASK = 0x8CA5,
  188. VIEWPORT = 0x0BA2,
  189. SCISSOR_BOX = 0x0C10,
  190. COLOR_CLEAR_VALUE = 0x0C22,
  191. COLOR_WRITEMASK = 0x0C23,
  192. UNPACK_ALIGNMENT = 0x0CF5,
  193. PACK_ALIGNMENT = 0x0D05,
  194. MAX_TEXTURE_SIZE = 0x0D33,
  195. MAX_VIEWPORT_DIMS = 0x0D3A,
  196. SUBPIXEL_BITS = 0x0D50,
  197. RED_BITS = 0x0D52,
  198. GREEN_BITS = 0x0D53,
  199. BLUE_BITS = 0x0D54,
  200. ALPHA_BITS = 0x0D55,
  201. DEPTH_BITS = 0x0D56,
  202. STENCIL_BITS = 0x0D57,
  203. POLYGON_OFFSET_UNITS = 0x2A00,
  204. POLYGON_OFFSET_FACTOR = 0x8038,
  205. TEXTURE_BINDING_2D = 0x8069,
  206. SAMPLE_BUFFERS = 0x80A8,
  207. SAMPLES = 0x80A9,
  208. SAMPLE_COVERAGE_VALUE = 0x80AA,
  209. SAMPLE_COVERAGE_INVERT = 0x80AB,
  210. NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2,
  211. COMPRESSED_TEXTURE_FORMATS = 0x86A3,
  212. DONT_CARE = 0x1100,
  213. FASTEST = 0x1101,
  214. NICEST = 0x1102,
  215. GENERATE_MIPMAP_HINT = 0x8192,
  216. BYTE = 0x1400,
  217. UNSIGNED_BYTE = 0x1401,
  218. SHORT = 0x1402,
  219. UNSIGNED_SHORT = 0x1403,
  220. INT = 0x1404,
  221. UNSIGNED_INT = 0x1405,
  222. FLOAT = 0x1406,
  223. FIXED = 0x140C,
  224. DEPTH_COMPONENT = 0x1902,
  225. ALPHA = 0x1906,
  226. RGB = 0x1907,
  227. RGBA = 0x1908,
  228. LUMINANCE = 0x1909,
  229. LUMINANCE_ALPHA = 0x190A,
  230. UNSIGNED_SHORT_4_4_4_4 = 0x8033,
  231. UNSIGNED_SHORT_5_5_5_1 = 0x8034,
  232. UNSIGNED_SHORT_5_6_5 = 0x8363,
  233. FRAGMENT_SHADER = 0x8B30,
  234. VERTEX_SHADER = 0x8B31,
  235. MAX_VERTEX_ATTRIBS = 0x8869,
  236. MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB,
  237. MAX_VARYING_VECTORS = 0x8DFC,
  238. MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D,
  239. MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C,
  240. MAX_TEXTURE_IMAGE_UNITS = 0x8872,
  241. MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD,
  242. SHADER_TYPE = 0x8B4F,
  243. DELETE_STATUS = 0x8B80,
  244. LINK_STATUS = 0x8B82,
  245. VALIDATE_STATUS = 0x8B83,
  246. ATTACHED_SHADERS = 0x8B85,
  247. ACTIVE_UNIFORMS = 0x8B86,
  248. ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
  249. ACTIVE_ATTRIBUTES = 0x8B89,
  250. ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A,
  251. SHADING_LANGUAGE_VERSION = 0x8B8C,
  252. CURRENT_PROGRAM = 0x8B8D,
  253. NEVER = 0x0200,
  254. LESS = 0x0201,
  255. EQUAL = 0x0202,
  256. LEQUAL = 0x0203,
  257. GREATER = 0x0204,
  258. NOTEQUAL = 0x0205,
  259. GEQUAL = 0x0206,
  260. ALWAYS = 0x0207,
  261. KEEP = 0x1E00,
  262. REPLACE = 0x1E01,
  263. INCR = 0x1E02,
  264. DECR = 0x1E03,
  265. INVERT = 0x150A,
  266. INCR_WRAP = 0x8507,
  267. DECR_WRAP = 0x8508,
  268. VENDOR = 0x1F00,
  269. RENDERER = 0x1F01,
  270. VERSION = 0x1F02,
  271. EXTENSIONS = 0x1F03,
  272. NEAREST = 0x2600,
  273. LINEAR = 0x2601,
  274. NEAREST_MIPMAP_NEAREST = 0x2700,
  275. LINEAR_MIPMAP_NEAREST = 0x2701,
  276. NEAREST_MIPMAP_LINEAR = 0x2702,
  277. LINEAR_MIPMAP_LINEAR = 0x2703,
  278. TEXTURE_MAG_FILTER = 0x2800,
  279. TEXTURE_MIN_FILTER = 0x2801,
  280. TEXTURE_WRAP_S = 0x2802,
  281. TEXTURE_WRAP_T = 0x2803,
  282. TEXTURE = 0x1702,
  283. TEXTURE_CUBE_MAP = 0x8513,
  284. TEXTURE_BINDING_CUBE_MAP = 0x8514,
  285. TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515,
  286. TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516,
  287. TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517,
  288. TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518,
  289. TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519,
  290. TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A,
  291. MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C,
  292. TEXTURE0 = 0x84C0,
  293. TEXTURE1 = 0x84C1,
  294. TEXTURE2 = 0x84C2,
  295. TEXTURE3 = 0x84C3,
  296. TEXTURE4 = 0x84C4,
  297. TEXTURE5 = 0x84C5,
  298. TEXTURE6 = 0x84C6,
  299. TEXTURE7 = 0x84C7,
  300. TEXTURE8 = 0x84C8,
  301. TEXTURE9 = 0x84C9,
  302. TEXTURE10 = 0x84CA,
  303. TEXTURE11 = 0x84CB,
  304. TEXTURE12 = 0x84CC,
  305. TEXTURE13 = 0x84CD,
  306. TEXTURE14 = 0x84CE,
  307. TEXTURE15 = 0x84CF,
  308. TEXTURE16 = 0x84D0,
  309. TEXTURE17 = 0x84D1,
  310. TEXTURE18 = 0x84D2,
  311. TEXTURE19 = 0x84D3,
  312. TEXTURE20 = 0x84D4,
  313. TEXTURE21 = 0x84D5,
  314. TEXTURE22 = 0x84D6,
  315. TEXTURE23 = 0x84D7,
  316. TEXTURE24 = 0x84D8,
  317. TEXTURE25 = 0x84D9,
  318. TEXTURE26 = 0x84DA,
  319. TEXTURE27 = 0x84DB,
  320. TEXTURE28 = 0x84DC,
  321. TEXTURE29 = 0x84DD,
  322. TEXTURE30 = 0x84DE,
  323. TEXTURE31 = 0x84DF,
  324. ACTIVE_TEXTURE = 0x84E0,
  325. REPEAT = 0x2901,
  326. CLAMP_TO_EDGE = 0x812F,
  327. MIRRORED_REPEAT = 0x8370,
  328. FLOAT_VEC2 = 0x8B50,
  329. FLOAT_VEC3 = 0x8B51,
  330. FLOAT_VEC4 = 0x8B52,
  331. INT_VEC2 = 0x8B53,
  332. INT_VEC3 = 0x8B54,
  333. INT_VEC4 = 0x8B55,
  334. BOOL = 0x8B56,
  335. BOOL_VEC2 = 0x8B57,
  336. BOOL_VEC3 = 0x8B58,
  337. BOOL_VEC4 = 0x8B59,
  338. FLOAT_MAT2 = 0x8B5A,
  339. FLOAT_MAT3 = 0x8B5B,
  340. FLOAT_MAT4 = 0x8B5C,
  341. SAMPLER_2D = 0x8B5E,
  342. SAMPLER_CUBE = 0x8B60,
  343. VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622,
  344. VERTEX_ATTRIB_ARRAY_SIZE = 0x8623,
  345. VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624,
  346. VERTEX_ATTRIB_ARRAY_TYPE = 0x8625,
  347. VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A,
  348. VERTEX_ATTRIB_ARRAY_POINTER = 0x8645,
  349. VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F,
  350. COMPILE_STATUS = 0x8B81,
  351. INFO_LOG_LENGTH = 0x8B84,
  352. SHADER_SOURCE_LENGTH = 0x8B88,
  353. SHADER_COMPILER = 0x8DFA,
  354. SHADER_BINARY_FORMATS = 0x8DF8,
  355. NUM_SHADER_BINARY_FORMATS = 0x8DF9,
  356. LOW_FLOAT = 0x8DF0,
  357. MEDIUM_FLOAT = 0x8DF1,
  358. HIGH_FLOAT = 0x8DF2,
  359. LOW_INT = 0x8DF3,
  360. MEDIUM_INT = 0x8DF4,
  361. HIGH_INT = 0x8DF5,
  362. FRAMEBUFFER = 0x8D40,
  363. RENDERBUFFER = 0x8D41,
  364. RGBA4 = 0x8056,
  365. RGB5_A1 = 0x8057,
  366. RGB565 = 0x8D62,
  367. DEPTH_COMPONENT16 = 0x81A5,
  368. STENCIL_INDEX = 0x1901,
  369. STENCIL_INDEX8 = 0x8D48,
  370. DEPTH_STENCIL = 0x84F9,
  371. RENDERBUFFER_WIDTH = 0x8D42,
  372. RENDERBUFFER_HEIGHT = 0x8D43,
  373. RENDERBUFFER_INTERNAL_FORMAT = 0x8D44,
  374. RENDERBUFFER_RED_SIZE = 0x8D50,
  375. RENDERBUFFER_GREEN_SIZE = 0x8D51,
  376. RENDERBUFFER_BLUE_SIZE = 0x8D52,
  377. RENDERBUFFER_ALPHA_SIZE = 0x8D53,
  378. RENDERBUFFER_DEPTH_SIZE = 0x8D54,
  379. RENDERBUFFER_STENCIL_SIZE = 0x8D55,
  380. FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0,
  381. FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1,
  382. FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2,
  383. FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3,
  384. COLOR_ATTACHMENT0 = 0x8CE0,
  385. DEPTH_ATTACHMENT = 0x8D00,
  386. STENCIL_ATTACHMENT = 0x8D20,
  387. DEPTH_STENCIL_ATTACHMENT = 0x821A,
  388. NONE = 0,
  389. FRAMEBUFFER_COMPLETE = 0x8CD5,
  390. FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6,
  391. FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7,
  392. FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9,
  393. FRAMEBUFFER_UNSUPPORTED = 0x8CDD,
  394. FRAMEBUFFER_BINDING = 0x8CA6,
  395. RENDERBUFFER_BINDING = 0x8CA7,
  396. MAX_RENDERBUFFER_SIZE = 0x84E8,
  397. INVALID_FRAMEBUFFER_OPERATION = 0x0506,
  398. // WebGL-specific enums
  399. UNPACK_FLIP_Y_WEBGL = 0x9240,
  400. UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
  401. CONTEXT_LOST_WEBGL = 0x9242,
  402. UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243,
  403. BROWSER_DEFAULT_WEBGL = 0x9244
  404. };
  405. // Context creation attributes.
  406. struct Attributes {
  407. Attributes()
  408. : alpha(true)
  409. , depth(true)
  410. , stencil(false)
  411. , antialias(true)
  412. , premultipliedAlpha(true)
  413. , canRecoverFromContextLoss(true)
  414. , preserveDrawingBuffer(false)
  415. {
  416. }
  417. bool alpha;
  418. bool depth;
  419. bool stencil;
  420. bool antialias;
  421. bool premultipliedAlpha;
  422. bool canRecoverFromContextLoss;
  423. bool preserveDrawingBuffer;
  424. };
  425. enum RenderStyle {
  426. RenderOffscreen,
  427. RenderDirectlyToHostWindow
  428. };
  429. class ContextLostCallback {
  430. public:
  431. virtual void onContextLost() = 0;
  432. virtual ~ContextLostCallback() {}
  433. };
  434. void setContextLostCallback(PassOwnPtr<ContextLostCallback>);
  435. static PassRefPtr<GraphicsContext3D> create(Attributes, HostWindow*, RenderStyle = RenderOffscreen);
  436. ~GraphicsContext3D();
  437. #if PLATFORM(MAC)
  438. PlatformGraphicsContext3D platformGraphicsContext3D() const { return m_contextObj; }
  439. Platform3DObject platformTexture() const { return m_compositorTexture; }
  440. CALayer* platformLayer() const { return reinterpret_cast<CALayer*>(m_webGLLayer.get()); }
  441. #elif PLATFORM(CHROMIUM)
  442. PlatformGraphicsContext3D platformGraphicsContext3D() const;
  443. Platform3DObject platformTexture() const;
  444. #if USE(ACCELERATED_COMPOSITING)
  445. PlatformLayer* platformLayer() const;
  446. #endif
  447. #elif PLATFORM(QT)
  448. PlatformGraphicsContext3D platformGraphicsContext3D();
  449. Platform3DObject platformTexture() const;
  450. #if USE(ACCELERATED_COMPOSITING)
  451. PlatformLayer* platformLayer() const;
  452. #endif
  453. #elif PLATFORM(GTK)
  454. PlatformGraphicsContext3D platformGraphicsContext3D();
  455. Platform3DObject platformTexture() const { return m_texture; }
  456. #else
  457. PlatformGraphicsContext3D platformGraphicsContext3D() const { return NullPlatformGraphicsContext3D; }
  458. Platform3DObject platformTexture() const { return NullPlatform3DObject; }
  459. #if USE(ACCELERATED_COMPOSITING)
  460. PlatformLayer* platformLayer() const { return 0; }
  461. #endif
  462. #endif
  463. void makeContextCurrent();
  464. PassRefPtr<DrawingBuffer> createDrawingBuffer(const IntSize& = IntSize());
  465. #if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(GTK)
  466. // With multisampling on, blit from multisampleFBO to regular FBO.
  467. void prepareTexture();
  468. #endif
  469. // Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
  470. // Return true if no GL error is synthesized.
  471. // By default, alignment is 4, the OpenGL default setting.
  472. bool texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint alignment = 4);
  473. bool isGLES2Compliant() const;
  474. //----------------------------------------------------------------------
  475. // Helpers for texture uploading and pixel readback.
  476. //
  477. // Computes the components per pixel and bytes per component
  478. // for the given format and type combination. Returns false if
  479. // either was an invalid enum.
  480. bool computeFormatAndTypeParameters(GC3Denum format,
  481. GC3Denum type,
  482. unsigned int* componentsPerPixel,
  483. unsigned int* bytesPerComponent);
  484. // Computes the image size in bytes. If paddingInBytes is not null, padding
  485. // is also calculated in return. Returns NO_ERROR if succeed, otherwise
  486. // return the suggested GL error indicating the cause of the failure:
  487. // INVALID_VALUE if width/height is negative or overflow happens.
  488. // INVALID_ENUM if format/type is illegal.
  489. GC3Denum computeImageSizeInBytes(GC3Denum format,
  490. GC3Denum type,
  491. GC3Dsizei width,
  492. GC3Dsizei height,
  493. GC3Dint alignment,
  494. unsigned int* imageSizeInBytes,
  495. unsigned int* paddingInBytes);
  496. // Extracts the contents of the given Image into the passed Vector,
  497. // packing the pixel data according to the given format and type,
  498. // and obeying the flipY, premultiplyAlpha, and ignoreGammaAndColorProfile
  499. // flags. Returns true upon success.
  500. bool extractImageData(Image* image,
  501. GC3Denum format,
  502. GC3Denum type,
  503. bool flipY,
  504. bool premultiplyAlpha,
  505. bool ignoreGammaAndColorProfile,
  506. Vector<uint8_t>& data);
  507. // Extracts the contents of the given ImageData into the passed Vector,
  508. // packing the pixel data according to the given format and type,
  509. // and obeying the flipY and premultiplyAlpha flags. Returns true
  510. // upon success.
  511. bool extractImageData(ImageData*,
  512. GC3Denum format,
  513. GC3Denum type,
  514. bool flipY,
  515. bool premultiplyAlpha,
  516. Vector<uint8_t>& data);
  517. // Helper function which extracts the user-supplied texture
  518. // data, applying the flipY and premultiplyAlpha parameters.
  519. // If the data is not tightly packed according to the passed
  520. // unpackAlignment, the output data will be tightly packed.
  521. // Returns true if successful, false if any error occurred.
  522. bool extractTextureData(unsigned int width, unsigned int height,
  523. GC3Denum format, GC3Denum type,
  524. unsigned int unpackAlignment,
  525. bool flipY, bool premultiplyAlpha,
  526. const void* pixels,
  527. Vector<uint8_t>& data);
  528. // Flips the given image data vertically, in-place.
  529. void flipVertically(void* imageData,
  530. unsigned int width,
  531. unsigned int height,
  532. unsigned int bytesPerPixel,
  533. unsigned int unpackAlignment);
  534. // Attempt to enumerate all possible native image formats to
  535. // reduce the amount of temporary allocations during texture
  536. // uploading. This enum must be public because it is accessed
  537. // by non-member functions.
  538. enum SourceDataFormat {
  539. SourceFormatRGBA8 = 0,
  540. SourceFormatRGBA16Little,
  541. SourceFormatRGBA16Big,
  542. SourceFormatRGBA32F,
  543. SourceFormatRGB8,
  544. SourceFormatRGB16Little,
  545. SourceFormatRGB16Big,
  546. SourceFormatRGB32F,
  547. SourceFormatBGR8,
  548. SourceFormatBGRA8,
  549. SourceFormatBGRA16Little,
  550. SourceFormatBGRA16Big,
  551. SourceFormatARGB8,
  552. SourceFormatARGB16Little,
  553. SourceFormatARGB16Big,
  554. SourceFormatABGR8,
  555. SourceFormatRGBA5551,
  556. SourceFormatRGBA4444,
  557. SourceFormatRGB565,
  558. SourceFormatR8,
  559. SourceFormatR16Little,
  560. SourceFormatR16Big,
  561. SourceFormatR32F,
  562. SourceFormatRA8,
  563. SourceFormatRA16Little,
  564. SourceFormatRA16Big,
  565. SourceFormatRA32F,
  566. SourceFormatAR8,
  567. SourceFormatAR16Little,
  568. SourceFormatAR16Big,
  569. SourceFormatA8,
  570. SourceFormatA16Little,
  571. SourceFormatA16Big,
  572. SourceFormatA32F,
  573. SourceFormatNumFormats
  574. };
  575. //----------------------------------------------------------------------
  576. // Entry points for WebGL.
  577. //
  578. void activeTexture(GC3Denum texture);
  579. void attachShader(Platform3DObject program, Platform3DObject shader);
  580. void bindAttribLocation(Platform3DObject, GC3Duint index, const String& name);
  581. void bindBuffer(GC3Denum target, Platform3DObject);
  582. void bindFramebuffer(GC3Denum target, Platform3DObject);
  583. void bindRenderbuffer(GC3Denum target, Platform3DObject);
  584. void bindTexture(GC3Denum target, Platform3DObject);
  585. void blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
  586. void blendEquation(GC3Denum mode);
  587. void blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha);
  588. void blendFunc(GC3Denum sfactor, GC3Denum dfactor);
  589. void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha);
  590. void bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage);
  591. void bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage);
  592. void bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data);
  593. GC3Denum checkFramebufferStatus(GC3Denum target);
  594. void clear(GC3Dbitfield mask);
  595. void clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
  596. void clearDepth(GC3Dclampf depth);
  597. void clearStencil(GC3Dint s);
  598. void colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha);
  599. void compileShader(Platform3DObject);
  600. // void compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data);
  601. // void compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data);
  602. void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border);
  603. void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
  604. void cullFace(GC3Denum mode);
  605. void depthFunc(GC3Denum func);
  606. void depthMask(GC3Dboolean flag);
  607. void depthRange(GC3Dclampf zNear, GC3Dclampf zFar);
  608. void detachShader(Platform3DObject, Platform3DObject);
  609. void disable(GC3Denum cap);
  610. void disableVertexAttribArray(GC3Duint index);
  611. void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count);
  612. void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset);
  613. void enable(GC3Denum cap);
  614. void enableVertexAttribArray(GC3Duint index);
  615. void finish();
  616. void flush();
  617. void framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject);
  618. void framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject, GC3Dint level);
  619. void frontFace(GC3Denum mode);
  620. void generateMipmap(GC3Denum target);
  621. bool getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo&);
  622. bool getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo&);
  623. void getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders);
  624. GC3Dint getAttribLocation(Platform3DObject, const String& name);
  625. void getBooleanv(GC3Denum pname, GC3Dboolean* value);
  626. void getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
  627. Attributes getContextAttributes();
  628. GC3Denum getError();
  629. void getFloatv(GC3Denum pname, GC3Dfloat* value);
  630. void getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value);
  631. void getIntegerv(GC3Denum pname, GC3Dint* value);
  632. void getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value);
  633. String getProgramInfoLog(Platform3DObject);
  634. void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
  635. void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
  636. String getShaderInfoLog(Platform3DObject);
  637. // TBD
  638. // void glGetShaderPrecisionFormat (GC3Denum shadertype, GC3Denum precisiontype, GC3Dint* range, GC3Dint* precision);
  639. String getShaderSource(Platform3DObject);
  640. String getString(GC3Denum name);
  641. void getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value);
  642. void getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
  643. void getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value);
  644. void getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value);
  645. GC3Dint getUniformLocation(Platform3DObject, const String& name);
  646. void getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value);
  647. void getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value);
  648. GC3Dsizeiptr getVertexAttribOffset(GC3Duint index, GC3Denum pname);
  649. void hint(GC3Denum target, GC3Denum mode);
  650. GC3Dboolean isBuffer(Platform3DObject);
  651. GC3Dboolean isEnabled(GC3Denum cap);
  652. GC3Dboolean isFramebuffer(Platform3DObject);
  653. GC3Dboolean isProgram(Platform3DObject);
  654. GC3Dboolean isRenderbuffer(Platform3DObject);
  655. GC3Dboolean isShader(Platform3DObject);
  656. GC3Dboolean isTexture(Platform3DObject);
  657. void lineWidth(GC3Dfloat);
  658. void linkProgram(Platform3DObject);
  659. void pixelStorei(GC3Denum pname, GC3Dint param);
  660. void polygonOffset(GC3Dfloat factor, GC3Dfloat units);
  661. void readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
  662. void releaseShaderCompiler();
  663. void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
  664. void sampleCoverage(GC3Dclampf value, GC3Dboolean invert);
  665. void scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
  666. void shaderSource(Platform3DObject, const String& string);
  667. void stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask);
  668. void stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask);
  669. void stencilMask(GC3Duint mask);
  670. void stencilMaskSeparate(GC3Denum face, GC3Duint mask);
  671. void stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
  672. void stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
  673. bool texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
  674. void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
  675. void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
  676. void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels);
  677. // FIXME: change the argument orders to match OpenGL's.
  678. void uniform1f(GC3Dint location, GC3Dfloat x);
  679. void uniform1fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
  680. void uniform1i(GC3Dint location, GC3Dint x);
  681. void uniform1iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
  682. void uniform2f(GC3Dint location, GC3Dfloat x, float y);
  683. void uniform2fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
  684. void uniform2i(GC3Dint location, GC3Dint x, GC3Dint y);
  685. void uniform2iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
  686. void uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
  687. void uniform3fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
  688. void uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z);
  689. void uniform3iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
  690. void uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
  691. void uniform4fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
  692. void uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w);
  693. void uniform4iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
  694. void uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
  695. void uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
  696. void uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
  697. void useProgram(Platform3DObject);
  698. void validateProgram(Platform3DObject);
  699. void vertexAttrib1f(GC3Duint index, GC3Dfloat x);
  700. void vertexAttrib1fv(GC3Duint index, GC3Dfloat* values);
  701. void vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y);
  702. void vertexAttrib2fv(GC3Duint index, GC3Dfloat* values);
  703. void vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
  704. void vertexAttrib3fv(GC3Duint index, GC3Dfloat* values);
  705. void vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
  706. void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values);
  707. void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized,
  708. GC3Dsizei stride, GC3Dintptr offset);
  709. void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
  710. void reshape(int width, int height);
  711. #if USE(CG)
  712. void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
  713. int canvasWidth, int canvasHeight, CGContextRef context);
  714. #elif PLATFORM(GTK)
  715. void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
  716. int canvasWidth, int canvasHeight, PlatformContextCairo* context);
  717. #endif
  718. void markContextChanged();
  719. void markLayerComposited();
  720. bool layerComposited() const;
  721. void paintRenderingResultsToCanvas(CanvasRenderingContext* context);
  722. PassRefPtr<ImageData> paintRenderingResultsToImageData();
  723. #if PLATFORM(QT)
  724. bool paintsIntoCanvasBuffer() const { return true; }
  725. #elif PLATFORM(CHROMIUM)
  726. bool paintsIntoCanvasBuffer() const;
  727. #elif PLATFORM(GTK)
  728. bool paintsIntoCanvasBuffer() const { return true; }
  729. #else
  730. bool paintsIntoCanvasBuffer() const { return false; }
  731. #endif
  732. // Support for buffer creation and deletion
  733. Platform3DObject createBuffer();
  734. Platform3DObject createFramebuffer();
  735. Platform3DObject createProgram();
  736. Platform3DObject createRenderbuffer();
  737. Platform3DObject createShader(GC3Denum);
  738. Platform3DObject createTexture();
  739. void deleteBuffer(Platform3DObject);
  740. void deleteFramebuffer(Platform3DObject);
  741. void deleteProgram(Platform3DObject);
  742. void deleteRenderbuffer(Platform3DObject);
  743. void deleteShader(Platform3DObject);
  744. void deleteTexture(Platform3DObject);
  745. // Synthesizes an OpenGL error which will be returned from a
  746. // later call to getError. This is used to emulate OpenGL ES
  747. // 2.0 behavior on the desktop and to enforce additional error
  748. // checking mandated by WebGL.
  749. //
  750. // Per the behavior of glGetError, this stores at most one
  751. // instance of any given error, and returns them from calls to
  752. // getError in the order they were added.
  753. void synthesizeGLError(GC3Denum error);
  754. // Support for extensions. Returns a non-null object, though not
  755. // all methods it contains may necessarily be supported on the
  756. // current hardware. Must call Extensions3D::supports() to
  757. // determine this.
  758. Extensions3D* getExtensions();
  759. IntSize getInternalFramebufferSize();
  760. private:
  761. GraphicsContext3D(Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow);
  762. // Each platform must provide an implementation of this method.
  763. //
  764. // Gets the data for the given Image into outputVector in the
  765. // format specified by the (OpenGL-style) format and type
  766. // arguments. Despite the fact that the outputVector contains
  767. // uint8_t, if the format and type specify packed pixels, then
  768. // it will essentially contain uint16_t after the extraction
  769. // process.
  770. //
  771. // If premultiplyAlpha is true, the alpha channel, if any,
  772. // will be multiplied into the color channels during the
  773. // extraction process. This premultiplication occurs before
  774. // any packing of pixel data.
  775. //
  776. // If ignoreGammaAndColorProfile is true, gamma correction and ICC
  777. // profile won't be applied.
  778. //
  779. // No vertical flip of the image data is performed by this
  780. // method.
  781. bool getImageData(Image* image,
  782. GC3Denum format,
  783. GC3Denum type,
  784. bool premultiplyAlpha,
  785. bool ignoreGammaAndColorProfile,
  786. Vector<uint8_t>& outputVector);
  787. // Possible alpha operations that may need to occur during
  788. // pixel packing. FIXME: kAlphaDoUnmultiply is lossy and must
  789. // be removed.
  790. enum AlphaOp {
  791. AlphaDoNothing = 0,
  792. AlphaDoPremultiply = 1,
  793. AlphaDoUnmultiply = 2
  794. };
  795. // Helper for getImageData which implements packing of pixel
  796. // data into the specified OpenGL destination format and type.
  797. // A sourceUnpackAlignment of zero indicates that the source
  798. // data is tightly packed. Non-zero values may take a slow path.
  799. // Destination data will have no gaps between rows.
  800. bool packPixels(const uint8_t* sourceData,
  801. SourceDataFormat sourceDataFormat,
  802. unsigned int width,
  803. unsigned int height,
  804. unsigned int sourceUnpackAlignment,
  805. unsigned int destinationFormat,
  806. unsigned int destinationType,
  807. AlphaOp alphaOp,
  808. void* destinationData);
  809. #if PLATFORM(MAC) || PLATFORM(GTK)
  810. // Take into account the user's requested context creation attributes,
  811. // in particular stencil and antialias, and determine which could or
  812. // could not be honored based on the capabilities of the OpenGL
  813. // implementation.
  814. void validateAttributes();
  815. // Read rendering results into a pixel array with the same format as the
  816. // backbuffer.
  817. void readRenderingResults(unsigned char* pixels, int pixelsSize);
  818. #endif
  819. int m_currentWidth, m_currentHeight;
  820. #if PLATFORM(MAC)
  821. CGLContextObj m_contextObj;
  822. RetainPtr<WebGLLayer> m_webGLLayer;
  823. #endif
  824. #if PLATFORM(MAC) || PLATFORM(GTK)
  825. typedef struct {
  826. String source;
  827. String log;
  828. bool isValid;
  829. } ShaderSourceEntry;
  830. HashMap<Platform3DObject, ShaderSourceEntry> m_shaderSourceMap;
  831. friend class Extensions3DOpenGL;
  832. ANGLEWebKitBridge m_compiler;
  833. OwnPtr<Extensions3DOpenGL> m_extensions;
  834. Attributes m_attrs;
  835. Vector<Vector<float> > m_vertexArray;
  836. GC3Duint m_texture, m_compositorTexture;
  837. GC3Duint m_fbo;
  838. GC3Duint m_depthStencilBuffer;
  839. bool m_layerComposited;
  840. GC3Duint m_internalColorFormat;
  841. // For tracking which FBO/texture is bound
  842. GC3Duint m_boundFBO;
  843. GC3Denum m_activeTexture;
  844. GC3Duint m_boundTexture0;
  845. // For multisampling
  846. GC3Duint m_multisampleFBO;
  847. GC3Duint m_multisampleDepthStencilBuffer;
  848. GC3Duint m_multisampleColorBuffer;
  849. // Errors raised by synthesizeGLError().
  850. ListHashSet<GC3Denum> m_syntheticErrors;
  851. #endif
  852. // FIXME: ideally this would be used on all platforms.
  853. #if PLATFORM(CHROMIUM) || PLATFORM(QT) || PLATFORM(GTK)
  854. friend class GraphicsContext3DInternal;
  855. OwnPtr<GraphicsContext3DInternal> m_internal;
  856. #endif
  857. };
  858. } // namespace WebCore
  859. #endif // GraphicsContext3D_h