Commit 19ba3d95 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[cleanup] Remove use of WTF::ArrayBuffer in test

The test uses WTF::ArrayBuffer as a replacement for a std::unique_ptr.
Since we are refactoring ArrayBuffer right now, it is better to get rid
of such uses.

R=urvang@chromium.org

Bug: chromium:1008840
Change-Id: Ib294217ecdf7a19c6eb1c19b07a0264c89841895
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827403Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701044}
parent 3bce0223
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "third_party/blink/renderer/platform/image-decoders/image_decoder_test_helpers.h" #include "third_party/blink/renderer/platform/image-decoders/image_decoder_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/histogram_tester.h" #include "third_party/blink/renderer/platform/testing/histogram_tester.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h" #include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
#include "third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer.h"
namespace blink { namespace blink {
...@@ -122,12 +121,13 @@ void ReadYUV(size_t max_decoded_bytes, ...@@ -122,12 +121,13 @@ void ReadYUV(size_t max_decoded_bytes,
row_bytes[1] = decoder->DecodedYUVWidthBytes(1); row_bytes[1] = decoder->DecodedYUVWidthBytes(1);
row_bytes[2] = decoder->DecodedYUVWidthBytes(2); row_bytes[2] = decoder->DecodedYUVWidthBytes(2);
scoped_refptr<ArrayBuffer> buffer(ArrayBuffer::Create( size_t planes_data_size = row_bytes[0] * y_size.Height() +
row_bytes[0] * y_size.Height() + row_bytes[1] * u_size.Height() + row_bytes[1] * u_size.Height() +
row_bytes[2] * v_size.Height(), row_bytes[2] * v_size.Height();
1)); std::unique_ptr<char[]> planes_data(new char[planes_data_size]);
void* planes[3]; void* planes[3];
planes[0] = buffer->Data(); planes[0] = reinterpret_cast<void*>(planes_data.get());
planes[1] = ((char*)planes[0]) + row_bytes[0] * y_size.Height(); planes[1] = ((char*)planes[0]) + row_bytes[0] * y_size.Height();
planes[2] = ((char*)planes[1]) + row_bytes[1] * u_size.Height(); planes[2] = ((char*)planes[1]) + row_bytes[1] * u_size.Height();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment