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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 forciblyEvictedContexts().set(context, generation++); | 198 forciblyEvictedContexts().set(context, generation++); |
199 } | 199 } |
200 | 200 |
201 void WebGLRenderingContextBase::removeFromEvictedList(WebGLRenderingContextBase*
context) | 201 void WebGLRenderingContextBase::removeFromEvictedList(WebGLRenderingContextBase*
context) |
202 { | 202 { |
203 forciblyEvictedContexts().remove(context); | 203 forciblyEvictedContexts().remove(context); |
204 } | 204 } |
205 | 205 |
206 void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* co
ntext) | 206 void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* co
ntext) |
207 { | 207 { |
| 208 #if ENABLE(OILPAN) |
| 209 // These two sets keep weak references to their contexts; |
| 210 // verify that the GC already removed the |context| entries. |
| 211 ASSERT(!forciblyEvictedContexts().contains(context)); |
| 212 ASSERT(!activeContexts().contains(context)); |
| 213 #else |
208 removeFromEvictedList(context); | 214 removeFromEvictedList(context); |
209 deactivateContext(context); | 215 deactivateContext(context); |
| 216 #endif |
210 | 217 |
211 // Try to re-enable the oldest inactive contexts. | 218 // Try to re-enable the oldest inactive contexts. |
212 while (activeContexts().size() < maxGLActiveContexts && forciblyEvictedConte
xts().size()) { | 219 while (activeContexts().size() < maxGLActiveContexts && forciblyEvictedConte
xts().size()) { |
213 WebGLRenderingContextBase* evictedContext = oldestEvictedContext(); | 220 WebGLRenderingContextBase* evictedContext = oldestEvictedContext(); |
214 if (!evictedContext->m_restoreAllowed) { | 221 if (!evictedContext->m_restoreAllowed) { |
215 forciblyEvictedContexts().remove(evictedContext); | 222 forciblyEvictedContexts().remove(evictedContext); |
216 continue; | 223 continue; |
217 } | 224 } |
218 | 225 |
219 IntSize desiredSize = DrawingBuffer::adjustSize(evictedContext->clampedC
anvasSize(), IntSize(), evictedContext->m_maxTextureSize); | 226 IntSize desiredSize = DrawingBuffer::adjustSize(evictedContext->clampedC
anvasSize(), IntSize(), evictedContext->m_maxTextureSize); |
(...skipping 6068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6288 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6295 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
6289 } | 6296 } |
6290 | 6297 |
6291 void WebGLRenderingContextBase::restoreUnpackParameters() | 6298 void WebGLRenderingContextBase::restoreUnpackParameters() |
6292 { | 6299 { |
6293 if (m_unpackAlignment != 1) | 6300 if (m_unpackAlignment != 1) |
6294 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6301 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
6295 } | 6302 } |
6296 | 6303 |
6297 } // namespace blink | 6304 } // namespace blink |
OLD | NEW |