| OLD | NEW |
| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 String getShaderSource(WebGLShader*); | 197 String getShaderSource(WebGLShader*); |
| 198 Vector<String> getSupportedExtensions(); | 198 Vector<String> getSupportedExtensions(); |
| 199 WebGLGetInfo getTexParameter(GLenum target, GLenum pname); | 199 WebGLGetInfo getTexParameter(GLenum target, GLenum pname); |
| 200 WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*); | 200 WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*); |
| 201 PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const Str
ing&); | 201 PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const Str
ing&); |
| 202 WebGLGetInfo getVertexAttrib(GLuint index, GLenum pname); | 202 WebGLGetInfo getVertexAttrib(GLuint index, GLenum pname); |
| 203 long long getVertexAttribOffset(GLuint index, GLenum pname); | 203 long long getVertexAttribOffset(GLuint index, GLenum pname); |
| 204 | 204 |
| 205 void hint(GLenum target, GLenum mode); | 205 void hint(GLenum target, GLenum mode); |
| 206 GLboolean isBuffer(WebGLBuffer*); | 206 GLboolean isBuffer(WebGLBuffer*); |
| 207 bool isContextLost(); | 207 bool isContextLost() const; |
| 208 GLboolean isEnabled(GLenum cap); | 208 GLboolean isEnabled(GLenum cap); |
| 209 GLboolean isFramebuffer(WebGLFramebuffer*); | 209 GLboolean isFramebuffer(WebGLFramebuffer*); |
| 210 GLboolean isProgram(WebGLProgram*); | 210 GLboolean isProgram(WebGLProgram*); |
| 211 GLboolean isRenderbuffer(WebGLRenderbuffer*); | 211 GLboolean isRenderbuffer(WebGLRenderbuffer*); |
| 212 GLboolean isShader(WebGLShader*); | 212 GLboolean isShader(WebGLShader*); |
| 213 GLboolean isTexture(WebGLTexture*); | 213 GLboolean isTexture(WebGLTexture*); |
| 214 | 214 |
| 215 void lineWidth(GLfloat); | 215 void lineWidth(GLfloat); |
| 216 void linkProgram(WebGLProgram*); | 216 void linkProgram(WebGLProgram*); |
| 217 void pixelStorei(GLenum pname, GLint param); | 217 void pixelStorei(GLenum pname, GLint param); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // Lost context provoked by WEBKIT_lose_context. | 316 // Lost context provoked by WEBKIT_lose_context. |
| 317 SyntheticLostContext, | 317 SyntheticLostContext, |
| 318 | 318 |
| 319 // A synthetic lost context that should attempt to recover automatically | 319 // A synthetic lost context that should attempt to recover automatically |
| 320 AutoRecoverSyntheticLostContext | 320 AutoRecoverSyntheticLostContext |
| 321 }; | 321 }; |
| 322 void forceLostContext(LostContextMode); | 322 void forceLostContext(LostContextMode); |
| 323 void forceRestoreContext(); | 323 void forceRestoreContext(); |
| 324 void loseContextImpl(LostContextMode); | 324 void loseContextImpl(LostContextMode); |
| 325 | 325 |
| 326 blink::WebGraphicsContext3D* webGraphicsContext3D() const { return m_context
.get(); } | 326 blink::WebGraphicsContext3D* webGraphicsContext3D() const; |
| 327 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } | 327 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } |
| 328 virtual blink::WebLayer* platformLayer() const OVERRIDE; | 328 virtual blink::WebLayer* platformLayer() const OVERRIDE; |
| 329 Extensions3DUtil* extensionsUtil(); | 329 Extensions3DUtil* extensionsUtil(); |
| 330 | 330 |
| 331 void reshape(int width, int height); | 331 void reshape(int width, int height); |
| 332 | 332 |
| 333 void markLayerComposited(); | 333 void markLayerComposited(); |
| 334 virtual void paintRenderingResultsToCanvas() OVERRIDE; | 334 virtual void paintRenderingResultsToCanvas() OVERRIDE; |
| 335 PassRefPtr<ImageData> paintRenderingResultsToImageData(); | 335 PassRefPtr<ImageData> paintRenderingResultsToImageData(); |
| 336 | 336 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // Adds a compressed texture format. | 383 // Adds a compressed texture format. |
| 384 void addCompressedTextureFormat(GLenum); | 384 void addCompressedTextureFormat(GLenum); |
| 385 void removeAllCompressedTextureFormats(); | 385 void removeAllCompressedTextureFormats(); |
| 386 | 386 |
| 387 PassRefPtr<Image> drawImageIntoBuffer(Image*, int width, int height); | 387 PassRefPtr<Image> drawImageIntoBuffer(Image*, int width, int height); |
| 388 | 388 |
| 389 PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy); | 389 PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy); |
| 390 | 390 |
| 391 WebGLRenderbuffer* ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuf
fer*); | 391 WebGLRenderbuffer* ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuf
fer*); |
| 392 | 392 |
| 393 OwnPtr<blink::WebGraphicsContext3D> m_context; | |
| 394 RefPtr<WebGLContextGroup> m_contextGroup; | |
| 395 | |
| 396 // Structure for rendering to a DrawingBuffer, instead of directly | 393 // Structure for rendering to a DrawingBuffer, instead of directly |
| 397 // to the back-buffer of m_context. | 394 // to the back-buffer of m_context. |
| 398 RefPtr<DrawingBuffer> m_drawingBuffer; | 395 RefPtr<DrawingBuffer> m_drawingBuffer; |
| 396 RefPtr<WebGLContextGroup> m_contextGroup; |
| 399 | 397 |
| 400 // Dispatches a context lost event once it is determined that one is needed. | 398 // Dispatches a context lost event once it is determined that one is needed. |
| 401 // This is used both for synthetic and real context losses. For real ones, i
t's | 399 // This is used both for synthetic and real context losses. For real ones, i
t's |
| 402 // likely that there's no JavaScript on the stack, but that might be depende
nt | 400 // likely that there's no JavaScript on the stack, but that might be depende
nt |
| 403 // on how exactly the platform discovers that the context was lost. For bett
er | 401 // on how exactly the platform discovers that the context was lost. For bett
er |
| 404 // portability we always defer the dispatch of the event. | 402 // portability we always defer the dispatch of the event. |
| 405 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; | 403 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; |
| 406 bool m_restoreAllowed; | 404 bool m_restoreAllowed; |
| 407 Timer<WebGLRenderingContextBase> m_restoreTimer; | 405 Timer<WebGLRenderingContextBase> m_restoreTimer; |
| 408 | 406 |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 // If the vector is empty, return the maximum allowed active context number. | 912 // If the vector is empty, return the maximum allowed active context number. |
| 915 static size_t oldestContextIndex(); | 913 static size_t oldestContextIndex(); |
| 916 static IntSize oldestContextSize(); | 914 static IntSize oldestContextSize(); |
| 917 }; | 915 }; |
| 918 | 916 |
| 919 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 917 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
| 920 | 918 |
| 921 } // namespace WebCore | 919 } // namespace WebCore |
| 922 | 920 |
| 923 #endif // WebGLRenderingContextBase_h | 921 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |