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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 if (isContextLost()) | 1238 if (isContextLost()) |
1239 return false; | 1239 return false; |
1240 | 1240 |
1241 bool mustClearNow = clearIfComposited() != Skipped; | 1241 bool mustClearNow = clearIfComposited() != Skipped; |
1242 if (!m_markedCanvasDirty && !mustClearNow) | 1242 if (!m_markedCanvasDirty && !mustClearNow) |
1243 return false; | 1243 return false; |
1244 | 1244 |
1245 canvas()->clearCopiedImage(); | 1245 canvas()->clearCopiedImage(); |
1246 m_markedCanvasDirty = false; | 1246 m_markedCanvasDirty = false; |
1247 | 1247 |
| 1248 if (!canvas()->buffer()) |
| 1249 return false; |
| 1250 |
1248 ScopedTexture2DRestorer restorer(this); | 1251 ScopedTexture2DRestorer restorer(this); |
1249 ScopedFramebufferRestorer fboRestorer(this); | 1252 ScopedFramebufferRestorer fboRestorer(this); |
1250 | 1253 |
1251 drawingBuffer()->commit(); | 1254 drawingBuffer()->commit(); |
1252 if (!canvas()->buffer()->copyRenderingResultsFromDrawingBuffer(drawingBuffer
(), sourceBuffer)) { | 1255 if (!canvas()->buffer()->copyRenderingResultsFromDrawingBuffer(drawingBuffer
(), sourceBuffer)) { |
1253 canvas()->ensureUnacceleratedImageBuffer(); | 1256 canvas()->ensureUnacceleratedImageBuffer(); |
1254 if (canvas()->hasImageBuffer()) | 1257 if (canvas()->hasImageBuffer()) |
1255 drawingBuffer()->paintRenderingResultsToCanvas(canvas()->buffer()); | 1258 drawingBuffer()->paintRenderingResultsToCanvas(canvas()->buffer()); |
1256 } | 1259 } |
1257 | 1260 |
(...skipping 5476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6734 | 6737 |
6735 return totalBytesPerPixel; | 6738 return totalBytesPerPixel; |
6736 } | 6739 } |
6737 | 6740 |
6738 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6741 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6739 { | 6742 { |
6740 return m_drawingBuffer.get(); | 6743 return m_drawingBuffer.get(); |
6741 } | 6744 } |
6742 | 6745 |
6743 } // namespace blink | 6746 } // namespace blink |
OLD | NEW |