diff options
author | fmalita <fmalita@chromium.org> | 2016-02-22 17:19:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-22 17:19:04 -0800 |
commit | d0c4e092d54d281991ecfdc2e4ddd5217e45b42a (patch) | |
tree | b7410292954a9f95bef49d7668adb8d82a07e0f8 /tests | |
parent | 888934723db64ebecb0d6e577ba7b70689d83dd2 (diff) |
Add dest type hint to SkShader::ContextRec
Let SkBlitter decide which dst type is optimal (PMColor vs PM4f), and
pass that info to shaders.
R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1724503002
Review URL: https://codereview.chromium.org/1724503002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SkColor4fTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/SkColor4fTest.cpp b/tests/SkColor4fTest.cpp index 97ae5e3d5b..00581cc1e6 100644 --- a/tests/SkColor4fTest.cpp +++ b/tests/SkColor4fTest.cpp @@ -148,7 +148,10 @@ DEF_TEST(Color4f_shader, reporter) { for (const auto& rec : recs) { uint32_t storage[200]; paint.setShader(rec.fFact())->unref(); - const SkShader::ContextRec contextRec(paint, SkMatrix::I(), nullptr); + // Encourage 4f context selection. At some point we may need + // to instantiate two separate contexts for optimal 4b/4f selection. + const SkShader::ContextRec contextRec(paint, SkMatrix::I(), nullptr, + SkShader::ContextRec::kPM4f_DstType); SkASSERT(paint.getShader()->contextSize(contextRec) <= sizeof(storage)); SkShader::Context* ctx = paint.getShader()->createContext(contextRec, storage); REPORTER_ASSERT(reporter, ctx->supports4f() == rec.fSupports4f); |