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

Unified Diff: test/cctest/test-api.cc

Issue 6546036: Combine typed and pixel arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: feedback, propagate external array type Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« src/objects-inl.h ('K') | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index cd2641270ff11578eeeae8d9b147785da30b73c8..8ac41fb860e4acf6a6a3e40c234439ed3d098a10 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -10549,8 +10549,8 @@ THREADED_TEST(PixelArray) {
LocalContext context;
const int kElementCount = 260;
uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount));
- i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(kElementCount,
- pixel_data);
+ i::Handle<i::ExternalPixelArray> pixels =
+ i::Factory::NewExternalPixelArray(kElementCount, pixel_data);
i::Heap::CollectAllGarbage(false); // Force GC to trigger verification.
for (int i = 0; i < kElementCount; i++) {
pixels->set(i, i % 256);
@@ -10890,7 +10890,7 @@ THREADED_TEST(PixelArray) {
" return sum; "
"}"
"for (var i = 0; i < 256; ++i) { pixels[i] = i; }"
- "for (var i = 0; i < 10000; ++i) {"
+ "for (var i = 0; i < 5000; ++i) {"
" result = pa_load(pixels);"
"}"
"result");
@@ -10907,7 +10907,7 @@ THREADED_TEST(PixelArray) {
" }"
" return sum; "
"}"
- "for (var i = 0; i < 100000; ++i) {"
+ "for (var i = 0; i < 5000; ++i) {"
" pa_init(pixels);"
"}"
"result = pa_load(pixels);"
@@ -10955,8 +10955,8 @@ THREADED_TEST(PixelArrayWithInterceptor) {
LocalContext context;
const int kElementCount = 260;
uint8_t* pixel_data = reinterpret_cast<uint8_t*>(malloc(kElementCount));
- i::Handle<i::PixelArray> pixels =
- i::Factory::NewPixelArray(kElementCount, pixel_data);
+ i::Handle<i::ExternalPixelArray> pixels =
+ i::Factory::NewExternalPixelArray(kElementCount, pixel_data);
for (int i = 0; i < kElementCount; i++) {
pixels->set(i, i % 256);
}
@@ -10984,6 +10984,7 @@ static int ExternalArrayElementSize(v8::ExternalArrayType array_type) {
switch (array_type) {
case v8::kExternalByteArray:
case v8::kExternalUnsignedByteArray:
+ case v8::kExternalPixelArray:
return 1;
break;
case v8::kExternalShortArray:
@@ -11374,6 +11375,14 @@ THREADED_TEST(ExternalUnsignedByteArray) {
}
+THREADED_TEST(ExternalPixelArray) {
+ ExternalArrayTestHelper<i::ExternalPixelArray, uint8_t>(
+ v8::kExternalPixelArray,
+ 0,
+ 255);
+}
+
+
THREADED_TEST(ExternalShortArray) {
ExternalArrayTestHelper<i::ExternalShortArray, int16_t>(
v8::kExternalShortArray,
@@ -11451,6 +11460,7 @@ THREADED_TEST(ExternalArrayInfo) {
ExternalArrayInfoTestHelper(v8::kExternalIntArray);
ExternalArrayInfoTestHelper(v8::kExternalUnsignedIntArray);
ExternalArrayInfoTestHelper(v8::kExternalFloatArray);
+ ExternalArrayInfoTestHelper(v8::kExternalPixelArray);
}
« src/objects-inl.h ('K') | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698