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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 virtual ~WebGLRenderingContextBase(); | 110 virtual ~WebGLRenderingContextBase(); |
111 | 111 |
112 virtual unsigned version() const = 0; | 112 virtual unsigned version() const = 0; |
113 virtual String contextName() const = 0; | 113 virtual String contextName() const = 0; |
114 virtual void registerContextExtensions() = 0; | 114 virtual void registerContextExtensions() = 0; |
115 | 115 |
116 virtual void initializeNewContext(); | 116 virtual void initializeNewContext(); |
117 | 117 |
118 static unsigned getWebGLVersion(const CanvasRenderingContext*); | 118 static unsigned getWebGLVersion(const CanvasRenderingContext*); |
119 | 119 |
120 static PassOwnPtr<blink::WebGraphicsContext3D> createWebGraphicsContext3D(HT
MLCanvasElement*, WebGLContextAttributes, unsigned webGLVersion); | 120 static PassOwnPtr<WebGraphicsContext3D> createWebGraphicsContext3D(HTMLCanva
sElement*, WebGLContextAttributes, unsigned webGLVersion); |
121 static void forceNextWebGLContextCreationToFail(); | 121 static void forceNextWebGLContextCreationToFail(); |
122 | 122 |
123 int drawingBufferWidth() const; | 123 int drawingBufferWidth() const; |
124 int drawingBufferHeight() const; | 124 int drawingBufferHeight() const; |
125 | 125 |
126 void activeTexture(GLenum texture); | 126 void activeTexture(GLenum texture); |
127 void attachShader(WebGLProgram*, WebGLShader*); | 127 void attachShader(WebGLProgram*, WebGLShader*); |
128 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); | 128 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); |
129 void bindBuffer(GLenum target, WebGLBuffer*); | 129 void bindBuffer(GLenum target, WebGLBuffer*); |
130 virtual void bindFramebuffer(GLenum target, WebGLFramebuffer*); | 130 virtual void bindFramebuffer(GLenum target, WebGLFramebuffer*); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // Restore when resources are available. | 344 // Restore when resources are available. |
345 WhenAvailable, | 345 WhenAvailable, |
346 | 346 |
347 // Restore as soon as possible. | 347 // Restore as soon as possible. |
348 Auto | 348 Auto |
349 }; | 349 }; |
350 void forceLostContext(LostContextMode, AutoRecoveryMethod); | 350 void forceLostContext(LostContextMode, AutoRecoveryMethod); |
351 void forceRestoreContext(); | 351 void forceRestoreContext(); |
352 void loseContextImpl(LostContextMode, AutoRecoveryMethod); | 352 void loseContextImpl(LostContextMode, AutoRecoveryMethod); |
353 | 353 |
354 blink::WebGraphicsContext3D* webContext() const { return drawingBuffer()->co
ntext(); } | 354 WebGraphicsContext3D* webContext() const { return drawingBuffer()->context()
; } |
355 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } | 355 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } |
356 Extensions3DUtil* extensionsUtil(); | 356 Extensions3DUtil* extensionsUtil(); |
357 | 357 |
358 void reshape(int width, int height); | 358 void reshape(int width, int height); |
359 | 359 |
360 void markLayerComposited(); | 360 void markLayerComposited(); |
361 PassRefPtrWillBeRawPtr<ImageData> paintRenderingResultsToImageData(SourceDra
wingBuffer); | 361 PassRefPtrWillBeRawPtr<ImageData> paintRenderingResultsToImageData(SourceDra
wingBuffer); |
362 | 362 |
363 void removeSharedObject(WebGLSharedObject*); | 363 void removeSharedObject(WebGLSharedObject*); |
364 void removeContextObject(WebGLContextObject*); | 364 void removeContextObject(WebGLContextObject*); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 friend class WebGLDebugShaders; | 401 friend class WebGLDebugShaders; |
402 friend class WebGLCompressedTextureATC; | 402 friend class WebGLCompressedTextureATC; |
403 friend class WebGLCompressedTextureETC1; | 403 friend class WebGLCompressedTextureETC1; |
404 friend class WebGLCompressedTexturePVRTC; | 404 friend class WebGLCompressedTexturePVRTC; |
405 friend class WebGLCompressedTextureS3TC; | 405 friend class WebGLCompressedTextureS3TC; |
406 friend class WebGLRenderingContextErrorMessageCallback; | 406 friend class WebGLRenderingContextErrorMessageCallback; |
407 friend class WebGLVertexArrayObjectOES; | 407 friend class WebGLVertexArrayObjectOES; |
408 friend class ScopedTexture2DRestorer; | 408 friend class ScopedTexture2DRestorer; |
409 friend class ScopedFramebufferRestorer; | 409 friend class ScopedFramebufferRestorer; |
410 | 410 |
411 WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphicsC
ontext3D>, const WebGLContextAttributes&); | 411 WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3
D>, const WebGLContextAttributes&); |
412 PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<blink::WebGraphicsC
ontext3D>); | 412 PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<WebGraphicsContext3
D>); |
413 void setupFlags(); | 413 void setupFlags(); |
414 | 414 |
415 #if ENABLE(OILPAN) | 415 #if ENABLE(OILPAN) |
416 PassRefPtr<WebGLSharedWebGraphicsContext3D> sharedWebGraphicsContext3D() con
st; | 416 PassRefPtr<WebGLSharedWebGraphicsContext3D> sharedWebGraphicsContext3D() con
st; |
417 #endif | 417 #endif |
418 | 418 |
419 // CanvasRenderingContext implementation. | 419 // CanvasRenderingContext implementation. |
420 virtual bool is3d() const override { return true; } | 420 virtual bool is3d() const override { return true; } |
421 virtual bool isAccelerated() const override { return true; } | 421 virtual bool isAccelerated() const override { return true; } |
422 virtual void setIsHidden(bool) override; | 422 virtual void setIsHidden(bool) override; |
423 bool paintRenderingResultsToCanvas(SourceDrawingBuffer) override; | 423 bool paintRenderingResultsToCanvas(SourceDrawingBuffer) override; |
424 virtual blink::WebLayer* platformLayer() const override; | 424 virtual WebLayer* platformLayer() const override; |
425 void stop() override; | 425 void stop() override; |
426 | 426 |
427 bool isWebGL2OrHigher() { return version() >= 2; } | 427 bool isWebGL2OrHigher() { return version() >= 2; } |
428 | 428 |
429 void addSharedObject(WebGLSharedObject*); | 429 void addSharedObject(WebGLSharedObject*); |
430 void addContextObject(WebGLContextObject*); | 430 void addContextObject(WebGLContextObject*); |
431 void detachAndRemoveAllObjects(); | 431 void detachAndRemoveAllObjects(); |
432 | 432 |
433 void destroyContext(); | 433 void destroyContext(); |
434 void markContextChanged(ContentChangeType); | 434 void markContextChanged(ContentChangeType); |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 static IntSize oldestContextSize(); | 1007 static IntSize oldestContextSize(); |
1008 }; | 1008 }; |
1009 | 1009 |
1010 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 1010 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
1011 | 1011 |
1012 } // namespace blink | 1012 } // namespace blink |
1013 | 1013 |
1014 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 1014 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
1015 | 1015 |
1016 #endif // WebGLRenderingContextBase_h | 1016 #endif // WebGLRenderingContextBase_h |
OLD | NEW |