| 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 21 matching lines...) Expand all Loading... |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context) | 34 WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context) |
| 35 : WebGLObject(context) | 35 : WebGLObject(context) |
| 36 , m_context(context) | 36 , m_context(context) |
| 37 { | 37 { |
| 38 } | 38 } |
| 39 | 39 |
| 40 WebGLContextObject::~WebGLContextObject() | 40 WebGLContextObject::~WebGLContextObject() |
| 41 { | 41 { |
| 42 #if !ENABLE(OILPAN) |
| 42 if (m_context) | 43 if (m_context) |
| 43 m_context->removeContextObject(this); | 44 m_context->removeContextObject(this); |
| 45 #endif |
| 44 } | 46 } |
| 45 | 47 |
| 46 void WebGLContextObject::detachContext() | 48 void WebGLContextObject::detachContext() |
| 47 { | 49 { |
| 48 detach(); | 50 detach(); |
| 49 if (m_context) { | 51 if (m_context) { |
| 50 deleteObject(m_context->webContext()); | 52 deleteObject(m_context->webContext()); |
| 51 m_context->removeContextObject(this); | 53 m_context->removeContextObject(this); |
| 52 m_context = 0; | 54 m_context = nullptr; |
| 53 } | 55 } |
| 54 } | 56 } |
| 55 | 57 |
| 58 #if !ENABLE(OILPAN) |
| 56 blink::WebGraphicsContext3D* WebGLContextObject::getAWebGraphicsContext3D() cons
t | 59 blink::WebGraphicsContext3D* WebGLContextObject::getAWebGraphicsContext3D() cons
t |
| 57 { | 60 { |
| 58 return m_context ? m_context->webContext() : 0; | 61 return m_context ? m_context->webContext() : 0; |
| 59 } | 62 } |
| 63 #endif |
| 64 |
| 65 void WebGLContextObject::trace(Visitor* visitor) |
| 66 { |
| 67 visitor->trace(m_context); |
| 68 WebGLObject::trace(visitor); |
| 69 } |
| 60 | 70 |
| 61 } | 71 } |
| OLD | NEW |