| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c
onst char* const* prefixes) | 608 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c
onst char* const* prefixes) |
| 609 : ExtensionTracker(flags, prefixes) | 609 : ExtensionTracker(flags, prefixes) |
| 610 , m_extensionField(extensionField) | 610 , m_extensionField(extensionField) |
| 611 { | 611 { |
| 612 } | 612 } |
| 613 | 613 |
| 614 virtual ~TypedExtensionTracker() | 614 virtual ~TypedExtensionTracker() |
| 615 { | 615 { |
| 616 if (m_extensionField) { | 616 if (m_extensionField) { |
| 617 m_extensionField->lose(true); | 617 m_extensionField->lose(true); |
| 618 m_extensionField = 0; | 618 m_extensionField = nullptr; |
| 619 } | 619 } |
| 620 } | 620 } |
| 621 | 621 |
| 622 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContext* c
ontext) const OVERRIDE | 622 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContext* c
ontext) const OVERRIDE |
| 623 { | 623 { |
| 624 if (!m_extensionField) | 624 if (!m_extensionField) |
| 625 m_extensionField = T::create(context); | 625 m_extensionField = T::create(context); |
| 626 | 626 |
| 627 return m_extensionField; | 627 return m_extensionField; |
| 628 } | 628 } |
| 629 | 629 |
| 630 virtual bool supported(WebGLRenderingContext* context) const OVERRIDE | 630 virtual bool supported(WebGLRenderingContext* context) const OVERRIDE |
| 631 { | 631 { |
| 632 return T::supported(context); | 632 return T::supported(context); |
| 633 } | 633 } |
| 634 | 634 |
| 635 virtual const char* extensionName() const OVERRIDE | 635 virtual const char* extensionName() const OVERRIDE |
| 636 { | 636 { |
| 637 return T::extensionName(); | 637 return T::extensionName(); |
| 638 } | 638 } |
| 639 | 639 |
| 640 virtual void loseExtension() OVERRIDE | 640 virtual void loseExtension() OVERRIDE |
| 641 { | 641 { |
| 642 if (m_extensionField) { | 642 if (m_extensionField) { |
| 643 m_extensionField->lose(false); | 643 m_extensionField->lose(false); |
| 644 if (m_extensionField->isLost()) | 644 if (m_extensionField->isLost()) |
| 645 m_extensionField = 0; | 645 m_extensionField = nullptr; |
| 646 } | 646 } |
| 647 } | 647 } |
| 648 | 648 |
| 649 private: | 649 private: |
| 650 RefPtr<T>& m_extensionField; | 650 RefPtr<T>& m_extensionField; |
| 651 }; | 651 }; |
| 652 | 652 |
| 653 Vector<ExtensionTracker*> m_extensions; | 653 Vector<ExtensionTracker*> m_extensions; |
| 654 | 654 |
| 655 template <typename T> | 655 template <typename T> |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 // If the vector is empty, return the maximum allowed active context number. | 917 // If the vector is empty, return the maximum allowed active context number. |
| 918 static size_t oldestContextIndex(); | 918 static size_t oldestContextIndex(); |
| 919 static IntSize oldestContextSize(); | 919 static IntSize oldestContextSize(); |
| 920 }; | 920 }; |
| 921 | 921 |
| 922 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, contex
t->is3d(), context.is3d()); | 922 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, contex
t->is3d(), context.is3d()); |
| 923 | 923 |
| 924 } // namespace WebCore | 924 } // namespace WebCore |
| 925 | 925 |
| 926 #endif | 926 #endif |
| OLD | NEW |