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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 m_markedCanvasDirty = false; | 1321 m_markedCanvasDirty = false; |
1322 | 1322 |
1323 if (!canvas()->buffer()) | 1323 if (!canvas()->buffer()) |
1324 return false; | 1324 return false; |
1325 | 1325 |
1326 ScopedTexture2DRestorer restorer(this); | 1326 ScopedTexture2DRestorer restorer(this); |
1327 ScopedFramebufferRestorer fboRestorer(this); | 1327 ScopedFramebufferRestorer fboRestorer(this); |
1328 | 1328 |
1329 drawingBuffer()->commit(); | 1329 drawingBuffer()->commit(); |
1330 if (!canvas()->buffer()->copyRenderingResultsFromDrawingBuffer(drawingBuffer
(), sourceBuffer)) { | 1330 if (!canvas()->buffer()->copyRenderingResultsFromDrawingBuffer(drawingBuffer
(), sourceBuffer)) { |
1331 canvas()->ensureUnacceleratedImageBuffer(); | 1331 // Currently, copyRenderingResultsFromDrawingBuffer is expected to alway
s succeed because cases |
1332 if (canvas()->hasImageBuffer()) | 1332 // where canvas()-buffer() is not accelerated are handle before reaching
this point. |
1333 drawingBuffer()->paintRenderingResultsToCanvas(canvas()->buffer()); | 1333 // If that assumption ever stops holding true, we may need to implement
a fallback right here. |
| 1334 ASSERT_NOT_REACHED(); |
| 1335 return false; |
1334 } | 1336 } |
1335 | 1337 |
1336 return true; | 1338 return true; |
1337 } | 1339 } |
1338 | 1340 |
1339 ImageData* WebGLRenderingContextBase::paintRenderingResultsToImageData(SourceDra
wingBuffer sourceBuffer) | 1341 ImageData* WebGLRenderingContextBase::paintRenderingResultsToImageData(SourceDra
wingBuffer sourceBuffer) |
1340 { | 1342 { |
1341 if (isContextLost()) | 1343 if (isContextLost()) |
1342 return nullptr; | 1344 return nullptr; |
1343 if (m_requestedAttributes.premultipliedAlpha()) | 1345 if (m_requestedAttributes.premultipliedAlpha()) |
(...skipping 5567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6911 | 6913 |
6912 return totalBytesPerPixel; | 6914 return totalBytesPerPixel; |
6913 } | 6915 } |
6914 | 6916 |
6915 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6917 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6916 { | 6918 { |
6917 return m_drawingBuffer.get(); | 6919 return m_drawingBuffer.get(); |
6918 } | 6920 } |
6919 | 6921 |
6920 } // namespace blink | 6922 } // namespace blink |
OLD | NEW |