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

Unified Diff: tests/SerializationTest.cpp

Issue 2064153002: Changed SkLightingShader API to take in a shader as color source (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-diffuse-factor-out
Patch Set: rebase Created 4 years, 6 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/SkLightingShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SerializationTest.cpp
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index 0f1bad3427fc80786f5da27f81ad04e9d9d00e26..7e5776c93ab7227c9956fa8e3494f0f308767705 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -5,8 +5,10 @@
* found in the LICENSE file.
*/
+#include <SkBitmapProcShader.h>
egdaniel 2016/06/21 14:37:30 why this top include?
reed1 2016/06/21 14:38:42 also, use "" instead of <>
dvonbeck 2016/06/21 14:47:55 Done. My bad! I thought I had fixed that.
#include "Resources.h"
#include "SkAnnotationKeys.h"
+#include "SkBitmapProcShader.h"
#include "SkCanvas.h"
#include "SkFixed.h"
#include "SkFontDescriptor.h"
@@ -579,9 +581,12 @@ DEF_TEST(Serialization, reporter) {
normals.allocN32Pixels(kTexSize, kTexSize);
sk_tool_utils::create_frustum_normal_map(&normals, SkIRect::MakeWH(kTexSize, kTexSize));
+ sk_sp<SkShader> diffuseShader = SkMakeBitmapShader(diffuse, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode, &matrix, nullptr);
sk_sp<SkNormalSource> normalSource = SkNormalSource::MakeMap(normals, invNormRotation, &matrix);
- sk_sp<SkShader> lightingShader = SkLightingShader::Make(diffuse, fLights, &matrix,
- std::move(normalSource));
+ sk_sp<SkShader> lightingShader = SkLightingShader::Make(std::move(diffuseShader),
+ std::move(normalSource),
+ fLights);
SkAutoTUnref<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter));
// TODO test equality?
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698