| 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 }; | 501 }; |
| 502 | 502 |
| 503 class WebGLRenderingContextLostCallback final : public NoBaseWillBeGarbageCollec
tedFinalized<WebGLRenderingContextLostCallback>, public WebGraphicsContext3D::We
bGraphicsContextLostCallback { | 503 class WebGLRenderingContextLostCallback final : public NoBaseWillBeGarbageCollec
tedFinalized<WebGLRenderingContextLostCallback>, public WebGraphicsContext3D::We
bGraphicsContextLostCallback { |
| 504 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WebGLRenderingContextLostCallback); | 504 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WebGLRenderingContextLostCallback); |
| 505 public: | 505 public: |
| 506 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextLostCallback> create(WebG
LRenderingContextBase* context) | 506 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextLostCallback> create(WebG
LRenderingContextBase* context) |
| 507 { | 507 { |
| 508 return adoptPtrWillBeNoop(new WebGLRenderingContextLostCallback(context)
); | 508 return adoptPtrWillBeNoop(new WebGLRenderingContextLostCallback(context)
); |
| 509 } | 509 } |
| 510 | 510 |
| 511 virtual ~WebGLRenderingContextLostCallback() { } | 511 ~WebGLRenderingContextLostCallback() override { } |
| 512 | 512 |
| 513 virtual void onContextLost() { m_context->forceLostContext(WebGLRenderingCon
textBase::RealLostContext, WebGLRenderingContextBase::Auto); } | 513 virtual void onContextLost() { m_context->forceLostContext(WebGLRenderingCon
textBase::RealLostContext, WebGLRenderingContextBase::Auto); } |
| 514 | 514 |
| 515 DEFINE_INLINE_TRACE() | 515 DEFINE_INLINE_TRACE() |
| 516 { | 516 { |
| 517 visitor->trace(m_context); | 517 visitor->trace(m_context); |
| 518 } | 518 } |
| 519 | 519 |
| 520 private: | 520 private: |
| 521 explicit WebGLRenderingContextLostCallback(WebGLRenderingContextBase* contex
t) | 521 explicit WebGLRenderingContextLostCallback(WebGLRenderingContextBase* contex
t) |
| 522 : m_context(context) { } | 522 : m_context(context) { } |
| 523 | 523 |
| 524 RawPtrWillBeMember<WebGLRenderingContextBase> m_context; | 524 RawPtrWillBeMember<WebGLRenderingContextBase> m_context; |
| 525 }; | 525 }; |
| 526 | 526 |
| 527 class WebGLRenderingContextErrorMessageCallback final : public NoBaseWillBeGarba
geCollectedFinalized<WebGLRenderingContextErrorMessageCallback>, public WebGraph
icsContext3D::WebGraphicsErrorMessageCallback { | 527 class WebGLRenderingContextErrorMessageCallback final : public NoBaseWillBeGarba
geCollectedFinalized<WebGLRenderingContextErrorMessageCallback>, public WebGraph
icsContext3D::WebGraphicsErrorMessageCallback { |
| 528 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WebGLRenderingContextErrorMessageCal
lback); | 528 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WebGLRenderingContextErrorMessageCal
lback); |
| 529 public: | 529 public: |
| 530 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextErrorMessageCallback> cre
ate(WebGLRenderingContextBase* context) | 530 static PassOwnPtrWillBeRawPtr<WebGLRenderingContextErrorMessageCallback> cre
ate(WebGLRenderingContextBase* context) |
| 531 { | 531 { |
| 532 return adoptPtrWillBeNoop(new WebGLRenderingContextErrorMessageCallback(
context)); | 532 return adoptPtrWillBeNoop(new WebGLRenderingContextErrorMessageCallback(
context)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 virtual ~WebGLRenderingContextErrorMessageCallback() { } | 535 ~WebGLRenderingContextErrorMessageCallback() override { } |
| 536 | 536 |
| 537 virtual void onErrorMessage(const WebString& message, WGC3Dint) | 537 virtual void onErrorMessage(const WebString& message, WGC3Dint) |
| 538 { | 538 { |
| 539 if (m_context->m_synthesizedErrorsToConsole) | 539 if (m_context->m_synthesizedErrorsToConsole) |
| 540 m_context->printGLErrorToConsole(message); | 540 m_context->printGLErrorToConsole(message); |
| 541 InspectorInstrumentation::didFireWebGLErrorOrWarning(m_context->canvas()
, message); | 541 InspectorInstrumentation::didFireWebGLErrorOrWarning(m_context->canvas()
, message); |
| 542 } | 542 } |
| 543 | 543 |
| 544 DEFINE_INLINE_TRACE() | 544 DEFINE_INLINE_TRACE() |
| 545 { | 545 { |
| (...skipping 5721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6267 | 6267 |
| 6268 return totalBytesPerPixel; | 6268 return totalBytesPerPixel; |
| 6269 } | 6269 } |
| 6270 | 6270 |
| 6271 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6271 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6272 { | 6272 { |
| 6273 return m_drawingBuffer.get(); | 6273 return m_drawingBuffer.get(); |
| 6274 } | 6274 } |
| 6275 | 6275 |
| 6276 } // namespace blink | 6276 } // namespace blink |
| OLD | NEW |