| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 17 matching lines...) Expand all Loading... |
| 28 namespace blink { | 28 namespace blink { |
| 29 | 29 |
| 30 WebGLContextGroup::WebGLContextGroup() : m_numberOfContextLosses(0) {} | 30 WebGLContextGroup::WebGLContextGroup() : m_numberOfContextLosses(0) {} |
| 31 | 31 |
| 32 gpu::gles2::GLES2Interface* WebGLContextGroup::getAGLInterface() { | 32 gpu::gles2::GLES2Interface* WebGLContextGroup::getAGLInterface() { |
| 33 DCHECK(!m_contexts.isEmpty()); | 33 DCHECK(!m_contexts.isEmpty()); |
| 34 return (*m_contexts.begin())->contextGL(); | 34 return (*m_contexts.begin())->contextGL(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void WebGLContextGroup::addContext(WebGLRenderingContextBase* context) { | 37 void WebGLContextGroup::addContext(WebGLRenderingContextBase* context) { |
| 38 m_contexts.add(TraceWrapperMember<WebGLRenderingContextBase>(this, context)); | 38 m_contexts.insert( |
| 39 TraceWrapperMember<WebGLRenderingContextBase>(this, context)); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void WebGLContextGroup::loseContextGroup( | 42 void WebGLContextGroup::loseContextGroup( |
| 42 WebGLRenderingContextBase::LostContextMode mode, | 43 WebGLRenderingContextBase::LostContextMode mode, |
| 43 WebGLRenderingContextBase::AutoRecoveryMethod autoRecoveryMethod) { | 44 WebGLRenderingContextBase::AutoRecoveryMethod autoRecoveryMethod) { |
| 44 ++m_numberOfContextLosses; | 45 ++m_numberOfContextLosses; |
| 45 for (WebGLRenderingContextBase* const context : m_contexts) | 46 for (WebGLRenderingContextBase* const context : m_contexts) |
| 46 context->loseContextImpl(mode, autoRecoveryMethod); | 47 context->loseContextImpl(mode, autoRecoveryMethod); |
| 47 } | 48 } |
| 48 | 49 |
| 49 uint32_t WebGLContextGroup::numberOfContextLosses() const { | 50 uint32_t WebGLContextGroup::numberOfContextLosses() const { |
| 50 return m_numberOfContextLosses; | 51 return m_numberOfContextLosses; |
| 51 } | 52 } |
| 52 | 53 |
| 53 DEFINE_TRACE_WRAPPERS(WebGLContextGroup) { | 54 DEFINE_TRACE_WRAPPERS(WebGLContextGroup) { |
| 54 for (auto context : m_contexts) { | 55 for (auto context : m_contexts) { |
| 55 visitor->traceWrappers(context); | 56 visitor->traceWrappers(context); |
| 56 } | 57 } |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace blink | 60 } // namespace blink |
| OLD | NEW |