Chromium Code Reviews| 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 5487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5498 #else | 5498 #else |
| 5499 m_drawingBuffer->beginDestruction(); | 5499 m_drawingBuffer->beginDestruction(); |
| 5500 m_drawingBuffer.clear(); | 5500 m_drawingBuffer.clear(); |
| 5501 #endif | 5501 #endif |
| 5502 } | 5502 } |
| 5503 | 5503 |
| 5504 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings, version( )); | 5504 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings, version( )); |
| 5505 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0)); | 5505 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0)); |
| 5506 RefPtr<DrawingBuffer> buffer; | 5506 RefPtr<DrawingBuffer> buffer; |
| 5507 // Even if a non-null WebGraphicsContext3D is created, until it's made curre nt, it isn't known whether the context is still lost. | 5507 // Even if a non-null WebGraphicsContext3D is created, until it's made curre nt, it isn't known whether the context is still lost. |
| 5508 if (context) { | 5508 if (context && context->makeContextCurrent()) { |
|
dshwang
2014/08/26 18:21:47
Currently, this code skipped the first makeContext
| |
| 5509 // Construct a new drawing buffer with the new WebGraphicsContext3D. | 5509 // Construct a new drawing buffer with the new WebGraphicsContext3D. |
| 5510 buffer = createDrawingBuffer(context.release()); | 5510 buffer = createDrawingBuffer(context.release()); |
| 5511 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null. | 5511 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null. |
| 5512 } | 5512 } |
| 5513 if (!buffer) { | 5513 if (!buffer) { |
| 5514 if (m_contextLostMode == RealLostContext) { | 5514 if (m_contextLostMode == RealLostContext) { |
| 5515 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE ); | 5515 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE ); |
| 5516 } else { | 5516 } else { |
| 5517 // This likely shouldn't happen but is the best way to report it to the WebGL app. | 5517 // This likely shouldn't happen but is the best way to report it to the WebGL app. |
| 5518 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context "); | 5518 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context "); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5758 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; | 5758 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; |
| 5759 } | 5759 } |
| 5760 #else | 5760 #else |
| 5761 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 5761 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 5762 { | 5762 { |
| 5763 return m_drawingBuffer.get(); | 5763 return m_drawingBuffer.get(); |
| 5764 } | 5764 } |
| 5765 #endif | 5765 #endif |
| 5766 | 5766 |
| 5767 } // namespace blink | 5767 } // namespace blink |
| OLD | NEW |