| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "modules/webgl/WebGLContextObject.h" | 26 #include "modules/webgl/WebGLContextObject.h" |
| 27 | 27 |
| 28 #include "modules/webgl/WebGLRenderingContextBase.h" | 28 #include "modules/webgl/WebGLRenderingContextBase.h" |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context) | 32 WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context) |
| 33 : WebGLObject(context), m_context(context) {} | 33 : WebGLObject(context), m_context(context) {} |
| 34 | 34 |
| 35 WebGLContextObject::~WebGLContextObject() {} | 35 uint32_t WebGLContextObject::currentNumberOfContextLosses() const { |
| 36 | 36 return m_context->numberOfContextLosses(); |
| 37 void WebGLContextObject::detachContext() { | |
| 38 detach(); | |
| 39 if (m_context) { | |
| 40 deleteObject(m_context->contextGL()); | |
| 41 m_context->removeContextObject(this); | |
| 42 m_context = nullptr; | |
| 43 } | |
| 44 } | 37 } |
| 45 | 38 |
| 46 gpu::gles2::GLES2Interface* WebGLContextObject::getAGLInterface() const { | 39 gpu::gles2::GLES2Interface* WebGLContextObject::getAGLInterface() const { |
| 47 return m_context->contextGL(); | 40 return m_context->contextGL(); |
| 48 } | 41 } |
| 49 | 42 |
| 50 DEFINE_TRACE(WebGLContextObject) { | 43 DEFINE_TRACE(WebGLContextObject) { |
| 51 visitor->trace(m_context); | 44 visitor->trace(m_context); |
| 52 WebGLObject::trace(visitor); | 45 WebGLObject::trace(visitor); |
| 53 } | 46 } |
| 54 | 47 |
| 55 } // namespace blink | 48 } // namespace blink |
| OLD | NEW |