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 5493 matching lines...) Loading... |
5504 #else | 5504 #else |
5505 m_drawingBuffer->beginDestruction(); | 5505 m_drawingBuffer->beginDestruction(); |
5506 m_drawingBuffer.clear(); | 5506 m_drawingBuffer.clear(); |
5507 #endif | 5507 #endif |
5508 } | 5508 } |
5509 | 5509 |
5510 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes->
attributes(canvas()->document().topDocument().url().string(), settings, version(
)); | 5510 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes->
attributes(canvas()->document().topDocument().url().string(), settings, version(
)); |
5511 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr
ent()->createOffscreenGraphicsContext3D(attributes, 0)); | 5511 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr
ent()->createOffscreenGraphicsContext3D(attributes, 0)); |
5512 RefPtr<DrawingBuffer> buffer; | 5512 RefPtr<DrawingBuffer> buffer; |
5513 // Even if a non-null WebGraphicsContext3D is created, until it's made curre
nt, it isn't known whether the context is still lost. | 5513 // Even if a non-null WebGraphicsContext3D is created, until it's made curre
nt, it isn't known whether the context is still lost. |
5514 if (context) { | 5514 if (context && context->makeContextCurrent()) { |
5515 // Construct a new drawing buffer with the new WebGraphicsContext3D. | 5515 // Construct a new drawing buffer with the new WebGraphicsContext3D. |
5516 buffer = createDrawingBuffer(context.release()); | 5516 buffer = createDrawingBuffer(context.release()); |
5517 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i
s set to null. | 5517 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i
s set to null. |
5518 } | 5518 } |
5519 if (!buffer) { | 5519 if (!buffer) { |
5520 if (m_contextLostMode == RealLostContext) { | 5520 if (m_contextLostMode == RealLostContext) { |
5521 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE
); | 5521 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE
); |
5522 } else { | 5522 } else { |
5523 // This likely shouldn't happen but is the best way to report it to
the WebGL app. | 5523 // This likely shouldn't happen but is the best way to report it to
the WebGL app. |
5524 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context
"); | 5524 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context
"); |
(...skipping 239 matching lines...) Loading... |
5764 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; | 5764 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; |
5765 } | 5765 } |
5766 #else | 5766 #else |
5767 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 5767 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
5768 { | 5768 { |
5769 return m_drawingBuffer.get(); | 5769 return m_drawingBuffer.get(); |
5770 } | 5770 } |
5771 #endif | 5771 #endif |
5772 | 5772 |
5773 } // namespace blink | 5773 } // namespace blink |
OLD | NEW |