2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
9 #include "SkPictureRecorder.h"
13 // Test that attempting to create a picture shader with a NULL picture or
14 // empty picture returns NULL.
15 DEF_TEST(PictureShader_empty, reporter) {
16 SkShader* shader = SkShader::CreatePictureShader(NULL,
17 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, NULL, NULL);
18 REPORTER_ASSERT(reporter, NULL == shader);
20 SkPictureRecorder factory;
21 factory.beginRecording(0, 0, NULL, 0);
22 SkAutoTUnref<SkPicture> picture(factory.endRecording());
23 shader = SkShader::CreatePictureShader(picture.get(),
24 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, NULL, NULL);
25 REPORTER_ASSERT(reporter, NULL == shader);