aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageGeneratorTest.cpp
diff options
context:
space:
mode:
authorGravatar sugoi <sugoi@chromium.org>2014-07-21 11:37:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-21 11:37:39 -0700
commit518d83dbc1c899e316e8c896af5defb58b83120f (patch)
tree035e0e6b97af79dc24037c647f6093ad9b33f9a9 /tests/ImageGeneratorTest.cpp
parent02cafcc1bf6e2968c2efdf459871167970da150e (diff)
Skia side RGB to YUV gpu conversion
This code is the one that's currently working in my local chromium build. A few things still need to be addressed and I'll highlight these directly in the code. BUG=skia: R=reed@google.com, bsalomon@google.com, senorblanco@google.com, senorblanco@chromium.org, robertphillips@google.com, scroggo@google.com, halcanary@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/374743003
Diffstat (limited to 'tests/ImageGeneratorTest.cpp')
-rw-r--r--tests/ImageGeneratorTest.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ImageGeneratorTest.cpp b/tests/ImageGeneratorTest.cpp
new file mode 100644
index 0000000000..aaf149b37c
--- /dev/null
+++ b/tests/ImageGeneratorTest.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkImageGenerator.h"
+#include "Test.h"
+
+DEF_TEST(ImageGenerator, reporter) {
+ SkImageGenerator ig;
+ SkISize sizes[3];
+ sizes[0] = SkISize::Make(200, 200);
+ sizes[1] = SkISize::Make(100, 100);
+ sizes[2] = SkISize::Make( 50, 50);
+ void* planes[3] = { NULL };
+ size_t rowBytes[3] = { 0 };
+
+ // Check that the YUV decoding API does not cause any crashes
+ ig.getYUV8Planes(sizes, NULL, NULL);
+ ig.getYUV8Planes(sizes, planes, NULL);
+ ig.getYUV8Planes(sizes, NULL, rowBytes);
+ ig.getYUV8Planes(sizes, planes, rowBytes);
+
+ int dummy;
+ planes[0] = planes[1] = planes[2] = &dummy;
+ rowBytes[0] = rowBytes[1] = rowBytes[2] = 250;
+
+ ig.getYUV8Planes(sizes, planes, rowBytes);
+}