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 27 matching lines...) Expand all Loading... |
38 #include "modules/webgl/WebGLContextAttributes.h" | 38 #include "modules/webgl/WebGLContextAttributes.h" |
39 #include "modules/webgl/WebGLExtensionName.h" | 39 #include "modules/webgl/WebGLExtensionName.h" |
40 #include "modules/webgl/WebGLTexture.h" | 40 #include "modules/webgl/WebGLTexture.h" |
41 #include "modules/webgl/WebGLVertexArrayObjectBase.h" | 41 #include "modules/webgl/WebGLVertexArrayObjectBase.h" |
42 #include "platform/Timer.h" | 42 #include "platform/Timer.h" |
43 #include "platform/graphics/GraphicsTypes3D.h" | 43 #include "platform/graphics/GraphicsTypes3D.h" |
44 #include "platform/graphics/ImageBuffer.h" | 44 #include "platform/graphics/ImageBuffer.h" |
45 #include "platform/graphics/gpu/DrawingBuffer.h" | 45 #include "platform/graphics/gpu/DrawingBuffer.h" |
46 #include "platform/graphics/gpu/Extensions3DUtil.h" | 46 #include "platform/graphics/gpu/Extensions3DUtil.h" |
47 #include "platform/graphics/gpu/WebGLImageConversion.h" | 47 #include "platform/graphics/gpu/WebGLImageConversion.h" |
48 #include "public/platform/WebGraphicsContext3D.h" | |
49 #include "wtf/OwnPtr.h" | 48 #include "wtf/OwnPtr.h" |
50 #include "wtf/text/WTFString.h" | 49 #include "wtf/text/WTFString.h" |
51 | 50 |
52 #include <set> | 51 #include <set> |
53 | 52 |
54 namespace blink { | 53 namespace blink { |
55 class WebLayer; | 54 class WebLayer; |
56 } | 55 } |
57 | 56 |
58 namespace gpu { | 57 namespace gpu { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 372 |
374 // Restore as soon as possible, but only when | 373 // Restore as soon as possible, but only when |
375 // the canvas is visible. | 374 // the canvas is visible. |
376 Auto | 375 Auto |
377 }; | 376 }; |
378 void loseContext(LostContextMode) override; | 377 void loseContext(LostContextMode) override; |
379 void forceLostContext(LostContextMode, AutoRecoveryMethod); | 378 void forceLostContext(LostContextMode, AutoRecoveryMethod); |
380 void forceRestoreContext(); | 379 void forceRestoreContext(); |
381 void loseContextImpl(LostContextMode, AutoRecoveryMethod); | 380 void loseContextImpl(LostContextMode, AutoRecoveryMethod); |
382 | 381 |
383 WebGraphicsContext3D* webContext() const { return drawingBuffer()->context()
; } | |
384 gpu::gles2::GLES2Interface* contextGL() const | 382 gpu::gles2::GLES2Interface* contextGL() const |
385 { | 383 { |
386 DrawingBuffer* d = drawingBuffer(); | 384 DrawingBuffer* d = drawingBuffer(); |
387 if (!d) | 385 if (!d) |
388 return nullptr; | 386 return nullptr; |
389 return d->contextGL(); | 387 return d->contextGL(); |
390 } | 388 } |
391 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } | 389 WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); } |
392 Extensions3DUtil* extensionsUtil(); | 390 Extensions3DUtil* extensionsUtil(); |
393 | 391 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 | 1007 |
1010 void dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*); | 1008 void dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*); |
1011 // Helper for restoration after context lost. | 1009 // Helper for restoration after context lost. |
1012 void maybeRestoreContext(Timer<WebGLRenderingContextBase>*); | 1010 void maybeRestoreContext(Timer<WebGLRenderingContextBase>*); |
1013 | 1011 |
1014 enum ConsoleDisplayPreference { | 1012 enum ConsoleDisplayPreference { |
1015 DisplayInConsole, | 1013 DisplayInConsole, |
1016 DontDisplayInConsole | 1014 DontDisplayInConsole |
1017 }; | 1015 }; |
1018 | 1016 |
1019 // Wrapper for WebGraphicsContext3D::synthesizeGLError that sends a message | 1017 // Reports an error to glGetError, sends a message to the JavaScript |
1020 // to the JavaScript console. | 1018 // console. |
1021 void synthesizeGLError(GLenum, const char* functionName, const char* descrip
tion, ConsoleDisplayPreference = DisplayInConsole); | 1019 void synthesizeGLError(GLenum, const char* functionName, const char* descrip
tion, ConsoleDisplayPreference = DisplayInConsole); |
1022 void emitGLWarning(const char* function, const char* reason); | 1020 void emitGLWarning(const char* function, const char* reason); |
1023 | 1021 |
1024 String ensureNotNull(const String&) const; | 1022 String ensureNotNull(const String&) const; |
1025 | 1023 |
1026 // Enable or disable stencil test based on user setting and | 1024 // Enable or disable stencil test based on user setting and |
1027 // whether the current FBO has a stencil buffer. | 1025 // whether the current FBO has a stencil buffer. |
1028 void applyStencilTest(); | 1026 void applyStencilTest(); |
1029 | 1027 |
1030 // Helper for enabling or disabling a capability. | 1028 // Helper for enabling or disabling a capability. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<W
ebGraphicsContext3DProvider>, const WebGLContextAttributes&); | 1079 WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<W
ebGraphicsContext3DProvider>, const WebGLContextAttributes&); |
1082 }; | 1080 }; |
1083 | 1081 |
1084 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 1082 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
1085 | 1083 |
1086 } // namespace blink | 1084 } // namespace blink |
1087 | 1085 |
1088 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 1086 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
1089 | 1087 |
1090 #endif // WebGLRenderingContextBase_h | 1088 #endif // WebGLRenderingContextBase_h |
OLD | NEW |