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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 , m_generatedImageCache(4) | 511 , m_generatedImageCache(4) |
512 , m_contextLost(false) | 512 , m_contextLost(false) |
513 , m_contextLostMode(SyntheticLostContext) | 513 , m_contextLostMode(SyntheticLostContext) |
514 , m_requestedAttributes(requestedAttributes->clone()) | 514 , m_requestedAttributes(requestedAttributes->clone()) |
515 , m_synthesizedErrorsToConsole(true) | 515 , m_synthesizedErrorsToConsole(true) |
516 , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole) | 516 , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole) |
517 , m_multisamplingAllowed(false) | 517 , m_multisamplingAllowed(false) |
518 , m_multisamplingObserverRegistered(false) | 518 , m_multisamplingObserverRegistered(false) |
519 , m_onePlusMaxEnabledAttribIndex(0) | 519 , m_onePlusMaxEnabledAttribIndex(0) |
520 , m_onePlusMaxNonDefaultTextureUnit(0) | 520 , m_onePlusMaxNonDefaultTextureUnit(0) |
| 521 , m_savingImage(false) |
521 { | 522 { |
522 ASSERT(context); | 523 ASSERT(context); |
523 | 524 |
524 m_contextGroup = WebGLContextGroup::create(); | 525 m_contextGroup = WebGLContextGroup::create(); |
525 m_contextGroup->addContext(this); | 526 m_contextGroup->addContext(this); |
526 | 527 |
527 m_maxViewportDims[0] = m_maxViewportDims[1] = 0; | 528 m_maxViewportDims[0] = m_maxViewportDims[1] = 0; |
528 context->getIntegerv(GL_MAX_VIEWPORT_DIMS, m_maxViewportDims); | 529 context->getIntegerv(GL_MAX_VIEWPORT_DIMS, m_maxViewportDims); |
529 | 530 |
530 m_drawingBuffer = createDrawingBuffer(context); | 531 m_drawingBuffer = createDrawingBuffer(context); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 canvas()->clearPresentationCopy(); | 835 canvas()->clearPresentationCopy(); |
835 | 836 |
836 // Until the canvas is written to by the application, the clear that | 837 // Until the canvas is written to by the application, the clear that |
837 // happened after it was composited should be ignored by the compositor. | 838 // happened after it was composited should be ignored by the compositor. |
838 if (m_drawingBuffer->layerComposited() && !m_requestedAttributes->preserveDr
awingBuffer()) { | 839 if (m_drawingBuffer->layerComposited() && !m_requestedAttributes->preserveDr
awingBuffer()) { |
839 m_drawingBuffer->paintCompositedResultsToCanvas(canvas()->buffer()); | 840 m_drawingBuffer->paintCompositedResultsToCanvas(canvas()->buffer()); |
840 | 841 |
841 canvas()->makePresentationCopy(); | 842 canvas()->makePresentationCopy(); |
842 } else | 843 } else |
843 canvas()->clearPresentationCopy(); | 844 canvas()->clearPresentationCopy(); |
| 845 |
844 clearIfComposited(); | 846 clearIfComposited(); |
845 | 847 |
846 if (!m_markedCanvasDirty && !m_layerCleared) | 848 if (!m_markedCanvasDirty && !m_layerCleared) |
847 return; | 849 return; |
848 | 850 |
849 canvas()->clearCopiedImage(); | 851 canvas()->clearCopiedImage(); |
850 m_markedCanvasDirty = false; | 852 m_markedCanvasDirty = false; |
851 | 853 |
852 ScopedTexture2DRestorer restorer(this); | 854 ScopedTexture2DRestorer restorer(this); |
853 | 855 |
854 m_drawingBuffer->commit(); | 856 m_drawingBuffer->commit(); |
855 if (!(canvas()->buffer())->copyRenderingResultsFromDrawingBuffer(m_drawingBu
ffer.get())) { | 857 if (!(canvas()->buffer())->copyRenderingResultsFromDrawingBuffer(m_drawingBu
ffer.get(), m_savingImage)) { |
856 canvas()->ensureUnacceleratedImageBuffer(); | 858 canvas()->ensureUnacceleratedImageBuffer(); |
857 if (canvas()->hasImageBuffer()) | 859 if (canvas()->hasImageBuffer()) |
858 m_drawingBuffer->paintRenderingResultsToCanvas(canvas()->buffer()); | 860 m_drawingBuffer->paintRenderingResultsToCanvas(canvas()->buffer()); |
859 } | 861 } |
860 | 862 |
861 if (m_framebufferBinding) | 863 if (m_framebufferBinding) |
862 webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebuffer
Binding.get())); | 864 webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebuffer
Binding.get())); |
863 else | 865 else |
864 m_drawingBuffer->bind(); | 866 m_drawingBuffer->bind(); |
865 } | 867 } |
(...skipping 4819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5685 if (m_textureUnits[i].m_texture2DBinding | 5687 if (m_textureUnits[i].m_texture2DBinding |
5686 || m_textureUnits[i].m_textureCubeMapBinding) { | 5688 || m_textureUnits[i].m_textureCubeMapBinding) { |
5687 m_onePlusMaxNonDefaultTextureUnit = i + 1; | 5689 m_onePlusMaxNonDefaultTextureUnit = i + 1; |
5688 return; | 5690 return; |
5689 } | 5691 } |
5690 } | 5692 } |
5691 m_onePlusMaxNonDefaultTextureUnit = 0; | 5693 m_onePlusMaxNonDefaultTextureUnit = 0; |
5692 } | 5694 } |
5693 | 5695 |
5694 } // namespace WebCore | 5696 } // namespace WebCore |
OLD | NEW |