skia2/tests/SkRasterPipelineTest.cpp
Mike Klein 433b306a70 Revert "Debug Mac test failure."
This reverts commit I0ed569b585f4962a90a0b6993acc484a74055177.

Reason for revert: Mac bots look okay now.  I am puzzled.

Original change's description:
> Debug Mac test failure.
> 
> CQ_EXTRA_TRYBOTS=master.client.skia:Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release-GN-Trybot
> TBR=
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2933
> 
> Change-Id: I0ed569b585f4962a90a0b6993acc484a74055177
> Reviewed-on: https://skia-review.googlesource.com/2933
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> 

TBR=mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I4feef1f58172d1cc649bc311c9e6d3c86f915617
Reviewed-on: https://skia-review.googlesource.com/2963
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-04 21:46:55 +00:00

49 lines
1.4 KiB
C++

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Test.h"
#include "SkHalf.h"
#include "SkRasterPipeline.h"
DEF_TEST(SkRasterPipeline, r) {
// Build and run a simple pipeline to exercise SkRasterPipeline,
// drawing 50% transparent blue over opaque red in half-floats.
Sk4h red = SkFloatToHalf_finite_ftz({ 1.0f, 0.0f, 0.0f, 1.0f }),
blue = SkFloatToHalf_finite_ftz({ 0.0f, 0.0f, 0.5f, 0.5f }),
result;
SkRasterPipeline p;
p.append(SkRasterPipeline::load_s_f16, &blue);
p.append(SkRasterPipeline::load_d_f16, &red);
p.append(SkRasterPipeline::srcover);
p.append(SkRasterPipeline::store_f16, &result);
p.run(1);
Sk4f f = SkHalfToFloat_finite_ftz(result);
// We should see half-intensity magenta.
REPORTER_ASSERT(r, f[0] == 0.5f);
REPORTER_ASSERT(r, f[1] == 0.0f);
REPORTER_ASSERT(r, f[2] == 0.5f);
REPORTER_ASSERT(r, f[3] == 1.0f);
}
DEF_TEST(SkRasterPipeline_empty, r) {
// No asserts... just a test that this is safe to run.
SkRasterPipeline p;
p.run(20);
}
DEF_TEST(SkRasterPipeline_nonsense, r) {
// No asserts... just a test that this is safe to run and terminates.
// srcover() calls st->next(); this makes sure we've always got something there to call.
SkRasterPipeline p;
p.append(SkRasterPipeline::srcover);
p.run(20);
}