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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 if (m_requestedAttributes.premultipliedAlpha()) | 1244 if (m_requestedAttributes.premultipliedAlpha()) |
1245 return nullptr; | 1245 return nullptr; |
1246 | 1246 |
1247 clearIfComposited(); | 1247 clearIfComposited(); |
1248 drawingBuffer()->commit(); | 1248 drawingBuffer()->commit(); |
1249 ScopedFramebufferRestorer restorer(this); | 1249 ScopedFramebufferRestorer restorer(this); |
1250 int width, height; | 1250 int width, height; |
1251 WTF::ArrayBufferContents contents; | 1251 WTF::ArrayBufferContents contents; |
1252 if (!drawingBuffer()->paintRenderingResultsToImageData(width, height, source
Buffer, contents)) | 1252 if (!drawingBuffer()->paintRenderingResultsToImageData(width, height, source
Buffer, contents)) |
1253 return nullptr; | 1253 return nullptr; |
1254 DOMArrayBuffer* imageDataPixels = DOMArrayBuffer::create(contents); | 1254 RefPtr<DOMArrayBuffer> imageDataPixels = DOMArrayBuffer::create(contents); |
1255 | 1255 |
1256 return ImageData::create( | 1256 return ImageData::create( |
1257 IntSize(width, height), | 1257 IntSize(width, height), |
1258 DOMUint8ClampedArray::create(imageDataPixels, 0, imageDataPixels->byteLe
ngth())); | 1258 DOMUint8ClampedArray::create(imageDataPixels, 0, imageDataPixels->byteLe
ngth())); |
1259 } | 1259 } |
1260 | 1260 |
1261 void WebGLRenderingContextBase::reshape(int width, int height) | 1261 void WebGLRenderingContextBase::reshape(int width, int height) |
1262 { | 1262 { |
1263 if (isContextLost()) | 1263 if (isContextLost()) |
1264 return; | 1264 return; |
(...skipping 5049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6314 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6314 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); |
6315 } | 6315 } |
6316 | 6316 |
6317 void WebGLRenderingContextBase::restoreUnpackParameters() | 6317 void WebGLRenderingContextBase::restoreUnpackParameters() |
6318 { | 6318 { |
6319 if (m_unpackAlignment != 1) | 6319 if (m_unpackAlignment != 1) |
6320 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6320 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
6321 } | 6321 } |
6322 | 6322 |
6323 } // namespace blink | 6323 } // namespace blink |
OLD | NEW |