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 5007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5018 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts); | 5018 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts); |
5019 else | 5019 else |
5020 // This likely shouldn't happen but is the best way to report it to
the WebGL app. | 5020 // This likely shouldn't happen but is the best way to report it to
the WebGL app. |
5021 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); | 5021 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); |
5022 return; | 5022 return; |
5023 } | 5023 } |
5024 | 5024 |
5025 // Construct a new drawing buffer with the new GraphicsContext3D. | 5025 // Construct a new drawing buffer with the new GraphicsContext3D. |
5026 if (m_drawingBuffer) { | 5026 if (m_drawingBuffer) { |
5027 m_drawingBuffer->discardResources(); | 5027 m_drawingBuffer->discardResources(); |
5028 m_drawingBuffer = DrawingBuffer::create(m_context.get(), m_drawingBuffer
->size(), !m_attributes.preserveDrawingBuffer); | 5028 m_drawingBuffer = DrawingBuffer::create(context.get(), m_drawingBuffer->
size(), !m_attributes.preserveDrawingBuffer); |
| 5029 m_drawingBuffer->bind(); |
5029 } | 5030 } |
5030 | 5031 |
5031 m_context = context; | 5032 m_context = context; |
5032 m_contextLost = false; | 5033 m_contextLost = false; |
5033 initializeNewContext(); | 5034 initializeNewContext(); |
5034 canvas()->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextr
estoredEvent, false, true, "")); | 5035 canvas()->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextr
estoredEvent, false, true, "")); |
5035 } | 5036 } |
5036 | 5037 |
5037 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity) | 5038 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity) |
5038 : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity])) | 5039 : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity])) |
(...skipping 27 matching lines...) Expand all Loading... |
5066 | 5067 |
5067 void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx) | 5068 void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx) |
5068 { | 5069 { |
5069 for (int i = idx; i > 0; --i) | 5070 for (int i = idx; i > 0; --i) |
5070 m_buffers[i].swap(m_buffers[i-1]); | 5071 m_buffers[i].swap(m_buffers[i-1]); |
5071 } | 5072 } |
5072 | 5073 |
5073 } // namespace WebCore | 5074 } // namespace WebCore |
5074 | 5075 |
5075 #endif // ENABLE(WEBGL) | 5076 #endif // ENABLE(WEBGL) |
OLD | NEW |