| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void removeContextObject(WebGLContextObject*); | 348 void removeContextObject(WebGLContextObject*); |
| 349 | 349 |
| 350 unsigned maxVertexAttribs() const { return m_maxVertexAttribs; } | 350 unsigned maxVertexAttribs() const { return m_maxVertexAttribs; } |
| 351 | 351 |
| 352 // ActiveDOMObject notifications | 352 // ActiveDOMObject notifications |
| 353 virtual bool hasPendingActivity() const override; | 353 virtual bool hasPendingActivity() const override; |
| 354 virtual void stop() override; | 354 virtual void stop() override; |
| 355 | 355 |
| 356 void setSavingImage(bool isSaving) { m_savingImage = isSaving; } | 356 void setSavingImage(bool isSaving) { m_savingImage = isSaving; } |
| 357 | 357 |
| 358 virtual void trace(Visitor*) override; | |
| 359 | |
| 360 class TextureUnitState { | 358 class TextureUnitState { |
| 361 ALLOW_ONLY_INLINE_ALLOCATION(); | 359 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 362 public: | 360 public: |
| 363 RefPtr<WebGLTexture> m_texture2DBinding; | 361 RefPtr<WebGLTexture> m_texture2DBinding; |
| 364 RefPtr<WebGLTexture> m_textureCubeMapBinding; | 362 RefPtr<WebGLTexture> m_textureCubeMapBinding; |
| 365 | |
| 366 void trace(Visitor*); | |
| 367 }; | 363 }; |
| 368 | 364 |
| 369 protected: | 365 protected: |
| 370 friend class WebGLDrawBuffers; | 366 friend class WebGLDrawBuffers; |
| 371 friend class WebGLFramebuffer; | 367 friend class WebGLFramebuffer; |
| 372 friend class WebGLObject; | 368 friend class WebGLObject; |
| 373 friend class WebGLContextObject; | 369 friend class WebGLContextObject; |
| 374 friend class OESVertexArrayObject; | 370 friend class OESVertexArrayObject; |
| 375 friend class WebGLDebugShaders; | 371 friend class WebGLDebugShaders; |
| 376 friend class WebGLCompressedTextureATC; | 372 friend class WebGLCompressedTextureATC; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 } | 588 } |
| 593 | 589 |
| 594 const char* const* prefixes() const; | 590 const char* const* prefixes() const; |
| 595 bool matchesNameWithPrefixes(const String&) const; | 591 bool matchesNameWithPrefixes(const String&) const; |
| 596 | 592 |
| 597 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContextBas
e*) = 0; | 593 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContextBas
e*) = 0; |
| 598 virtual bool supported(WebGLRenderingContextBase*) const = 0; | 594 virtual bool supported(WebGLRenderingContextBase*) const = 0; |
| 599 virtual const char* extensionName() const = 0; | 595 virtual const char* extensionName() const = 0; |
| 600 virtual void loseExtension() = 0; | 596 virtual void loseExtension() = 0; |
| 601 | 597 |
| 602 virtual void trace(Visitor*) { } | |
| 603 | |
| 604 private: | 598 private: |
| 605 bool m_draft; | 599 bool m_draft; |
| 606 const char* const* m_prefixes; | 600 const char* const* m_prefixes; |
| 607 }; | 601 }; |
| 608 | 602 |
| 609 template <typename T> | 603 template <typename T> |
| 610 class TypedExtensionTracker final : public ExtensionTracker { | 604 class TypedExtensionTracker final : public ExtensionTracker { |
| 611 public: | 605 public: |
| 612 static PassOwnPtr<TypedExtensionTracker<T> > create(RefPtr<T>& extension
Field, ExtensionFlags flags, const char* const* prefixes) | 606 static PassOwnPtr<TypedExtensionTracker<T> > create(RefPtr<T>& extension
Field, ExtensionFlags flags, const char* const* prefixes) |
| 613 { | 607 { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 | 640 |
| 647 virtual void loseExtension() override | 641 virtual void loseExtension() override |
| 648 { | 642 { |
| 649 if (m_extension) { | 643 if (m_extension) { |
| 650 m_extension->lose(false); | 644 m_extension->lose(false); |
| 651 if (m_extension->isLost()) | 645 if (m_extension->isLost()) |
| 652 m_extension = nullptr; | 646 m_extension = nullptr; |
| 653 } | 647 } |
| 654 } | 648 } |
| 655 | 649 |
| 656 virtual void trace(Visitor* visitor) override | |
| 657 { | |
| 658 visitor->trace(m_extension); | |
| 659 ExtensionTracker::trace(visitor); | |
| 660 } | |
| 661 | |
| 662 private: | 650 private: |
| 663 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c
onst char* const* prefixes) | 651 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c
onst char* const* prefixes) |
| 664 : ExtensionTracker(flags, prefixes) | 652 : ExtensionTracker(flags, prefixes) |
| 665 , m_extensionField(extensionField) | 653 , m_extensionField(extensionField) |
| 666 { | 654 { |
| 667 } | 655 } |
| 668 | 656 |
| 669 RefPtr<T>& m_extensionField; | 657 RefPtr<T>& m_extensionField; |
| 670 // ExtensionTracker holds it's own reference to the extension to ensure | 658 // ExtensionTracker holds it's own reference to the extension to ensure |
| 671 // that it is not deleted before this object's destructor is called | 659 // that it is not deleted before this object's destructor is called |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 static IntSize oldestContextSize(); | 933 static IntSize oldestContextSize(); |
| 946 }; | 934 }; |
| 947 | 935 |
| 948 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 936 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
| 949 | 937 |
| 950 } // namespace blink | 938 } // namespace blink |
| 951 | 939 |
| 952 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 940 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
| 953 | 941 |
| 954 #endif // WebGLRenderingContextBase_h | 942 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |