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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "core/html/canvas/WebGLContextObject.h" | 28 #include "core/html/canvas/WebGLContextObject.h" |
29 | 29 |
30 #include "core/html/canvas/WebGLRenderingContextBase.h" | 30 #include "core/html/canvas/WebGLRenderingContextBase.h" |
31 | 31 |
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 #if ENABLE(OILPAN) |
| 38 , m_sharedWebGraphicsContext3D(context->sharedWebGraphicsContext3D()) |
| 39 #endif |
37 { | 40 { |
38 } | 41 } |
39 | 42 |
40 WebGLContextObject::~WebGLContextObject() | 43 WebGLContextObject::~WebGLContextObject() |
41 { | 44 { |
| 45 #if !ENABLE(OILPAN) |
42 if (m_context) | 46 if (m_context) |
43 m_context->removeContextObject(this); | 47 m_context->removeContextObject(this); |
| 48 #endif |
44 } | 49 } |
45 | 50 |
46 void WebGLContextObject::detachContext() | 51 void WebGLContextObject::detachContext() |
47 { | 52 { |
48 detach(); | 53 detach(); |
49 if (m_context) { | 54 if (m_context) { |
50 deleteObject(m_context->webContext()); | 55 deleteObject(m_context->webContext()); |
51 m_context->removeContextObject(this); | 56 m_context->removeContextObject(this); |
52 m_context = 0; | 57 m_context = nullptr; |
| 58 #if ENABLE(OILPAN) |
| 59 m_sharedWebGraphicsContext3D.clear(); |
| 60 #endif |
53 } | 61 } |
54 } | 62 } |
55 | 63 |
56 blink::WebGraphicsContext3D* WebGLContextObject::getAWebGraphicsContext3D() cons
t | 64 blink::WebGraphicsContext3D* WebGLContextObject::getAWebGraphicsContext3D() cons
t |
57 { | 65 { |
| 66 #if ENABLE(OILPAN) |
| 67 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->webConte
xt() : 0; |
| 68 #else |
58 return m_context ? m_context->webContext() : 0; | 69 return m_context ? m_context->webContext() : 0; |
| 70 #endif |
| 71 } |
| 72 |
| 73 void WebGLContextObject::trace(Visitor* visitor) |
| 74 { |
| 75 visitor->trace(m_context); |
| 76 WebGLObject::trace(visitor); |
59 } | 77 } |
60 | 78 |
61 } | 79 } |
OLD | NEW |