Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 RefPtr<DOMArrayBuffer> imageDataPixels = DOMArrayBuffer::create(contents); 1254 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698