| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 public: | 506 public: |
| 507 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextLostCallback> create(WebG
LRenderingContextBase* context) | 507 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextLostCallback> create(WebG
LRenderingContextBase* context) |
| 508 { | 508 { |
| 509 return adoptPtrWillBeNoop(new WebGLRenderingContextLostCallback(context)
); | 509 return adoptPtrWillBeNoop(new WebGLRenderingContextLostCallback(context)
); |
| 510 } | 510 } |
| 511 | 511 |
| 512 virtual ~WebGLRenderingContextLostCallback() { } | 512 virtual ~WebGLRenderingContextLostCallback() { } |
| 513 | 513 |
| 514 virtual void onContextLost() { m_context->forceLostContext(WebGLRenderingCon
textBase::RealLostContext, WebGLRenderingContextBase::Auto); } | 514 virtual void onContextLost() { m_context->forceLostContext(WebGLRenderingCon
textBase::RealLostContext, WebGLRenderingContextBase::Auto); } |
| 515 | 515 |
| 516 void trace(Visitor* visitor) | 516 DEFINE_INLINE_TRACE() |
| 517 { | 517 { |
| 518 visitor->trace(m_context); | 518 visitor->trace(m_context); |
| 519 } | 519 } |
| 520 | 520 |
| 521 private: | 521 private: |
| 522 explicit WebGLRenderingContextLostCallback(WebGLRenderingContextBase* contex
t) | 522 explicit WebGLRenderingContextLostCallback(WebGLRenderingContextBase* contex
t) |
| 523 : m_context(context) { } | 523 : m_context(context) { } |
| 524 | 524 |
| 525 RawPtrWillBeMember<WebGLRenderingContextBase> m_context; | 525 RawPtrWillBeMember<WebGLRenderingContextBase> m_context; |
| 526 }; | 526 }; |
| 527 | 527 |
| 528 class WebGLRenderingContextErrorMessageCallback final : public NoBaseWillBeGarba
geCollectedFinalized<WebGLRenderingContextErrorMessageCallback>, public blink::W
ebGraphicsContext3D::WebGraphicsErrorMessageCallback { | 528 class WebGLRenderingContextErrorMessageCallback final : public NoBaseWillBeGarba
geCollectedFinalized<WebGLRenderingContextErrorMessageCallback>, public blink::W
ebGraphicsContext3D::WebGraphicsErrorMessageCallback { |
| 529 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 529 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 530 public: | 530 public: |
| 531 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextErrorMessageCallback> cre
ate(WebGLRenderingContextBase* context) | 531 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextErrorMessageCallback> cre
ate(WebGLRenderingContextBase* context) |
| 532 { | 532 { |
| 533 return adoptPtrWillBeNoop(new WebGLRenderingContextErrorMessageCallback(
context)); | 533 return adoptPtrWillBeNoop(new WebGLRenderingContextErrorMessageCallback(
context)); |
| 534 } | 534 } |
| 535 | 535 |
| 536 virtual ~WebGLRenderingContextErrorMessageCallback() { } | 536 virtual ~WebGLRenderingContextErrorMessageCallback() { } |
| 537 | 537 |
| 538 virtual void onErrorMessage(const blink::WebString& message, blink::WGC3Dint
) | 538 virtual void onErrorMessage(const blink::WebString& message, blink::WGC3Dint
) |
| 539 { | 539 { |
| 540 if (m_context->m_synthesizedErrorsToConsole) | 540 if (m_context->m_synthesizedErrorsToConsole) |
| 541 m_context->printGLErrorToConsole(message); | 541 m_context->printGLErrorToConsole(message); |
| 542 InspectorInstrumentation::didFireWebGLErrorOrWarning(m_context->canvas()
, message); | 542 InspectorInstrumentation::didFireWebGLErrorOrWarning(m_context->canvas()
, message); |
| 543 } | 543 } |
| 544 | 544 |
| 545 void trace(Visitor* visitor) | 545 DEFINE_INLINE_TRACE() |
| 546 { | 546 { |
| 547 visitor->trace(m_context); | 547 visitor->trace(m_context); |
| 548 } | 548 } |
| 549 | 549 |
| 550 private: | 550 private: |
| 551 explicit WebGLRenderingContextErrorMessageCallback(WebGLRenderingContextBase
* context) | 551 explicit WebGLRenderingContextErrorMessageCallback(WebGLRenderingContextBase
* context) |
| 552 : m_context(context) { } | 552 : m_context(context) { } |
| 553 | 553 |
| 554 RawPtrWillBeMember<WebGLRenderingContextBase> m_context; | 554 RawPtrWillBeMember<WebGLRenderingContextBase> m_context; |
| 555 }; | 555 }; |
| (...skipping 5380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5936 for (int i = startIndex; i >= 0; --i) { | 5936 for (int i = startIndex; i >= 0; --i) { |
| 5937 if (m_textureUnits[i].m_texture2DBinding | 5937 if (m_textureUnits[i].m_texture2DBinding |
| 5938 || m_textureUnits[i].m_textureCubeMapBinding) { | 5938 || m_textureUnits[i].m_textureCubeMapBinding) { |
| 5939 m_onePlusMaxNonDefaultTextureUnit = i + 1; | 5939 m_onePlusMaxNonDefaultTextureUnit = i + 1; |
| 5940 return; | 5940 return; |
| 5941 } | 5941 } |
| 5942 } | 5942 } |
| 5943 m_onePlusMaxNonDefaultTextureUnit = 0; | 5943 m_onePlusMaxNonDefaultTextureUnit = 0; |
| 5944 } | 5944 } |
| 5945 | 5945 |
| 5946 void WebGLRenderingContextBase::TextureUnitState::trace(Visitor* visitor) | 5946 DEFINE_TRACE(WebGLRenderingContextBase::TextureUnitState) |
| 5947 { | 5947 { |
| 5948 visitor->trace(m_texture2DBinding); | 5948 visitor->trace(m_texture2DBinding); |
| 5949 visitor->trace(m_textureCubeMapBinding); | 5949 visitor->trace(m_textureCubeMapBinding); |
| 5950 } | 5950 } |
| 5951 | 5951 |
| 5952 void WebGLRenderingContextBase::trace(Visitor* visitor) | 5952 DEFINE_TRACE(WebGLRenderingContextBase) |
| 5953 { | 5953 { |
| 5954 #if ENABLE(OILPAN) | 5954 #if ENABLE(OILPAN) |
| 5955 visitor->trace(m_contextObjects); | 5955 visitor->trace(m_contextObjects); |
| 5956 #endif | 5956 #endif |
| 5957 visitor->trace(m_contextLostCallbackAdapter); | 5957 visitor->trace(m_contextLostCallbackAdapter); |
| 5958 visitor->trace(m_errorMessageCallbackAdapter); | 5958 visitor->trace(m_errorMessageCallbackAdapter); |
| 5959 visitor->trace(m_boundArrayBuffer); | 5959 visitor->trace(m_boundArrayBuffer); |
| 5960 visitor->trace(m_defaultVertexArrayObject); | 5960 visitor->trace(m_defaultVertexArrayObject); |
| 5961 visitor->trace(m_boundVertexArrayObject); | 5961 visitor->trace(m_boundVertexArrayObject); |
| 5962 visitor->trace(m_vertexAttrib0Buffer); | 5962 visitor->trace(m_vertexAttrib0Buffer); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6010 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; | 6010 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; |
| 6011 } | 6011 } |
| 6012 #else | 6012 #else |
| 6013 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6013 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6014 { | 6014 { |
| 6015 return m_drawingBuffer.get(); | 6015 return m_drawingBuffer.get(); |
| 6016 } | 6016 } |
| 6017 #endif | 6017 #endif |
| 6018 | 6018 |
| 6019 } // namespace blink | 6019 } // namespace blink |
| OLD | NEW |