From 518d83dbc1c899e316e8c896af5defb58b83120f Mon Sep 17 00:00:00 2001 From: sugoi Date: Mon, 21 Jul 2014 11:37:39 -0700 Subject: 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 --- tests/ImageGeneratorTest.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/ImageGeneratorTest.cpp (limited to 'tests/ImageGeneratorTest.cpp') 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); +} -- cgit v1.2.3