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

Unified Diff: tests/PictureShaderTest.cpp

Issue 238253005: Fixes for SkPictureShader. (Closed) Base URL: https://skia.googlesource.com/skia.git@shaders
Patch Set: Rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureShaderTest.cpp
diff --git a/tests/PictureShaderTest.cpp b/tests/PictureShaderTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..17ef5b56be477542d7e0c07e2218d02607481674
--- /dev/null
+++ b/tests/PictureShaderTest.cpp
@@ -0,0 +1,26 @@
+/*
+ * 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 "SkPicture.h"
+#include "SkPictureRecorder.h"
+#include "SkShader.h"
+#include "Test.h"
+
+// Test that attempting to create a picture shader with a NULL picture or
+// empty picture returns NULL.
+DEF_TEST(PictureShader_empty, reporter) {
+ SkShader* shader = SkShader::CreatePictureShader(NULL,
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
+ REPORTER_ASSERT(reporter, NULL == shader);
+
+ SkPictureRecorder factory;
+ factory.beginRecording(0, 0, NULL, 0);
+ SkAutoTUnref<SkPicture> picture(factory.endRecording());
+ shader = SkShader::CreatePictureShader(picture.get(),
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
+ REPORTER_ASSERT(reporter, NULL == shader);
+}
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698