2017-06-06 18:27:16 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkTypes.h"
|
|
|
|
#include "tests/Test.h"
|
2017-06-06 18:27:16 +00:00
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/gpu/GrContext.h"
|
|
|
|
#include "include/private/GrRecordingContext.h"
|
2019-06-18 13:58:02 +00:00
|
|
|
#include "src/gpu/GrColor.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "src/gpu/GrContextPriv.h"
|
|
|
|
#include "src/gpu/GrGeometryProcessor.h"
|
2019-09-30 16:15:30 +00:00
|
|
|
#include "src/gpu/GrImageInfo.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "src/gpu/GrMemoryPool.h"
|
|
|
|
#include "src/gpu/GrOpFlushState.h"
|
2019-08-26 15:08:51 +00:00
|
|
|
#include "src/gpu/GrOpsRenderPass.h"
|
2019-10-08 16:32:56 +00:00
|
|
|
#include "src/gpu/GrProgramInfo.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "src/gpu/GrRecordingContextPriv.h"
|
|
|
|
#include "src/gpu/GrRenderTargetContext.h"
|
|
|
|
#include "src/gpu/GrRenderTargetContextPriv.h"
|
|
|
|
#include "src/gpu/GrResourceProvider.h"
|
|
|
|
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
|
|
|
|
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
|
|
|
|
#include "src/gpu/glsl/GrGLSLVarying.h"
|
|
|
|
#include "src/gpu/glsl/GrGLSLVertexGeoBuilder.h"
|
2017-06-06 18:27:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a GPU-backend specific test for dynamic pipeline state. It draws boxes using dynamic
|
|
|
|
* scissor rectangles then reads back the result to verify a successful test.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static constexpr int kScreenSize = 6;
|
|
|
|
static constexpr int kNumMeshes = 4;
|
|
|
|
static constexpr int kScreenSplitX = kScreenSize/2;
|
|
|
|
static constexpr int kScreenSplitY = kScreenSize/2;
|
|
|
|
|
2018-06-26 13:12:38 +00:00
|
|
|
static const SkIRect kDynamicScissors[kNumMeshes] = {
|
|
|
|
SkIRect::MakeLTRB(0, 0, kScreenSplitX, kScreenSplitY),
|
|
|
|
SkIRect::MakeLTRB(0, kScreenSplitY, kScreenSplitX, kScreenSize),
|
|
|
|
SkIRect::MakeLTRB(kScreenSplitX, 0, kScreenSize, kScreenSplitY),
|
|
|
|
SkIRect::MakeLTRB(kScreenSplitX, kScreenSplitY, kScreenSize, kScreenSize),
|
2017-06-06 18:27:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const GrColor kMeshColors[kNumMeshes] {
|
|
|
|
GrColorPackRGBA(255, 0, 0, 255),
|
|
|
|
GrColorPackRGBA(0, 255, 0, 255),
|
|
|
|
GrColorPackRGBA(0, 0, 255, 255),
|
|
|
|
GrColorPackRGBA(0, 0, 0, 255)
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Vertex {
|
|
|
|
float fX;
|
|
|
|
float fY;
|
|
|
|
GrColor fColor;
|
|
|
|
};
|
|
|
|
|
|
|
|
class GrPipelineDynamicStateTestProcessor : public GrGeometryProcessor {
|
|
|
|
public:
|
2019-11-20 21:08:10 +00:00
|
|
|
static GrGeometryProcessor* Make(SkArenaAlloc* arena) {
|
|
|
|
return arena->make<GrPipelineDynamicStateTestProcessor>();
|
2018-06-19 18:33:47 +00:00
|
|
|
}
|
2017-06-06 18:27:16 +00:00
|
|
|
|
|
|
|
const char* name() const override { return "GrPipelineDynamicStateTest Processor"; }
|
|
|
|
|
|
|
|
void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const final {}
|
|
|
|
|
|
|
|
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const final;
|
|
|
|
|
Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-12 20:34:00 +00:00
|
|
|
const Attribute& inVertex() const { return kAttributes[0]; }
|
|
|
|
const Attribute& inColor() const { return kAttributes[1]; }
|
2018-06-19 18:33:47 +00:00
|
|
|
|
Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-12 20:34:00 +00:00
|
|
|
private:
|
2019-11-20 21:08:10 +00:00
|
|
|
friend class ::SkArenaAlloc; // for access to ctor
|
|
|
|
|
|
|
|
GrPipelineDynamicStateTestProcessor()
|
|
|
|
: INHERITED(kGrPipelineDynamicStateTestProcessor_ClassID) {
|
|
|
|
this->setVertexAttributes(kAttributes, SK_ARRAY_COUNT(kAttributes));
|
|
|
|
}
|
|
|
|
|
Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-12 20:34:00 +00:00
|
|
|
static constexpr Attribute kAttributes[] = {
|
|
|
|
{"vertex", kFloat2_GrVertexAttribType, kHalf2_GrSLType},
|
|
|
|
{"color", kUByte4_norm_GrVertexAttribType, kHalf4_GrSLType},
|
|
|
|
};
|
2017-06-06 18:27:16 +00:00
|
|
|
|
|
|
|
friend class GLSLPipelineDynamicStateTestProcessor;
|
|
|
|
typedef GrGeometryProcessor INHERITED;
|
|
|
|
};
|
Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-12 20:34:00 +00:00
|
|
|
constexpr GrPrimitiveProcessor::Attribute GrPipelineDynamicStateTestProcessor::kAttributes[];
|
2017-06-06 18:27:16 +00:00
|
|
|
|
|
|
|
class GLSLPipelineDynamicStateTestProcessor : public GrGLSLGeometryProcessor {
|
|
|
|
void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor&,
|
2019-11-27 13:57:17 +00:00
|
|
|
const CoordTransformRange&) final {}
|
2017-06-06 18:27:16 +00:00
|
|
|
|
|
|
|
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) final {
|
|
|
|
const GrPipelineDynamicStateTestProcessor& mp =
|
|
|
|
args.fGP.cast<GrPipelineDynamicStateTestProcessor>();
|
|
|
|
|
|
|
|
GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
|
|
|
|
varyingHandler->emitAttributes(mp);
|
Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-12 20:34:00 +00:00
|
|
|
varyingHandler->addPassThroughAttribute(mp.inColor(), args.fOutputColor);
|
2017-06-06 18:27:16 +00:00
|
|
|
|
|
|
|
GrGLSLVertexBuilder* v = args.fVertBuilder;
|
Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-12 20:34:00 +00:00
|
|
|
v->codeAppendf("float2 vertex = %s;", mp.inVertex().name());
|
2017-09-20 15:24:15 +00:00
|
|
|
gpArgs->fPositionVar.set(kFloat2_GrSLType, "vertex");
|
2017-06-06 18:27:16 +00:00
|
|
|
|
2018-02-14 20:38:14 +00:00
|
|
|
GrGLSLFPFragmentBuilder* f = args.fFragBuilder;
|
2017-09-18 18:10:39 +00:00
|
|
|
f->codeAppendf("%s = half4(1);", args.fOutputCoverage);
|
2017-06-06 18:27:16 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
GrGLSLPrimitiveProcessor*
|
|
|
|
GrPipelineDynamicStateTestProcessor::createGLSLInstance(const GrShaderCaps&) const {
|
|
|
|
return new GLSLPipelineDynamicStateTestProcessor;
|
|
|
|
}
|
|
|
|
|
|
|
|
class GrPipelineDynamicStateTestOp : public GrDrawOp {
|
|
|
|
public:
|
|
|
|
DEFINE_OP_CLASS_ID
|
|
|
|
|
2019-02-15 16:33:22 +00:00
|
|
|
static std::unique_ptr<GrDrawOp> Make(GrRecordingContext* context,
|
2018-08-15 06:53:25 +00:00
|
|
|
GrScissorTest scissorTest,
|
2018-06-07 15:05:56 +00:00
|
|
|
sk_sp<const GrBuffer> vbuff) {
|
2019-02-04 18:26:26 +00:00
|
|
|
GrOpMemoryPool* pool = context->priv().opMemoryPool();
|
2018-06-19 17:09:54 +00:00
|
|
|
|
2018-08-15 06:53:25 +00:00
|
|
|
return pool->allocate<GrPipelineDynamicStateTestOp>(scissorTest, std::move(vbuff));
|
2018-06-07 15:05:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2018-06-12 14:11:12 +00:00
|
|
|
friend class GrOpMemoryPool;
|
|
|
|
|
2018-08-15 06:53:25 +00:00
|
|
|
GrPipelineDynamicStateTestOp(GrScissorTest scissorTest, sk_sp<const GrBuffer> vbuff)
|
2020-03-23 18:29:16 +00:00
|
|
|
: INHERITED(ClassID())
|
|
|
|
, fScissorTest(scissorTest)
|
|
|
|
, fVertexBuffer(std::move(vbuff)) {
|
2017-06-06 18:27:16 +00:00
|
|
|
this->setBounds(SkRect::MakeIWH(kScreenSize, kScreenSize),
|
2019-10-01 19:14:44 +00:00
|
|
|
HasAABloat::kNo, IsHairline::kNo);
|
2017-06-06 18:27:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const char* name() const override { return "GrPipelineDynamicStateTestOp"; }
|
|
|
|
FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
|
2020-03-23 18:29:16 +00:00
|
|
|
GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
|
|
|
|
bool hasMixedSampledCoverage, GrClampType) override {
|
|
|
|
return GrProcessorSet::EmptySetAnalysis();
|
2017-06-16 14:04:34 +00:00
|
|
|
}
|
2020-03-23 18:29:16 +00:00
|
|
|
void onPrePrepare(GrRecordingContext*,
|
2020-04-01 20:22:00 +00:00
|
|
|
const GrSurfaceProxyView* writeView,
|
2020-03-23 18:29:16 +00:00
|
|
|
GrAppliedClip*,
|
|
|
|
const GrXferProcessor::DstProxyView&) override {}
|
2017-06-06 18:27:16 +00:00
|
|
|
void onPrepare(GrOpFlushState*) override {}
|
2019-10-08 16:32:56 +00:00
|
|
|
void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) override {
|
2020-03-23 18:29:16 +00:00
|
|
|
GrPipeline pipeline(fScissorTest, SkBlendMode::kSrc,
|
2020-03-30 16:52:33 +00:00
|
|
|
flushState->drawOpArgs().writeSwizzle());
|
2020-03-16 15:25:50 +00:00
|
|
|
SkSTArray<kNumMeshes, GrSimpleMesh> meshes;
|
2017-06-06 18:27:16 +00:00
|
|
|
for (int i = 0; i < kNumMeshes; ++i) {
|
2020-03-16 15:25:50 +00:00
|
|
|
GrSimpleMesh& mesh = meshes.push_back();
|
2020-03-13 15:21:12 +00:00
|
|
|
mesh.set(fVertexBuffer, 4, 4 * i);
|
2017-06-06 18:27:16 +00:00
|
|
|
}
|
2019-10-08 16:32:56 +00:00
|
|
|
|
2020-03-23 18:29:16 +00:00
|
|
|
auto geomProc = GrPipelineDynamicStateTestProcessor::Make(flushState->allocator());
|
|
|
|
|
|
|
|
GrProgramInfo programInfo(flushState->proxy()->numSamples(),
|
|
|
|
flushState->proxy()->numStencilSamples(),
|
|
|
|
flushState->proxy()->backendFormat(),
|
2020-04-01 20:22:00 +00:00
|
|
|
flushState->writeView()->origin(),
|
2020-03-23 18:29:16 +00:00
|
|
|
&pipeline,
|
|
|
|
geomProc,
|
|
|
|
GrPrimitiveType::kTriangleStrip);
|
|
|
|
|
|
|
|
flushState->bindPipeline(programInfo, SkRect::MakeIWH(kScreenSize, kScreenSize));
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
2020-03-16 23:34:44 +00:00
|
|
|
if (fScissorTest == GrScissorTest::kEnabled) {
|
|
|
|
flushState->setScissorRect(kDynamicScissors[i]);
|
|
|
|
}
|
|
|
|
flushState->drawMesh(meshes[i]);
|
|
|
|
}
|
2017-06-06 18:27:16 +00:00
|
|
|
}
|
|
|
|
|
2018-08-15 06:53:25 +00:00
|
|
|
GrScissorTest fScissorTest;
|
2017-06-06 18:27:16 +00:00
|
|
|
const sk_sp<const GrBuffer> fVertexBuffer;
|
|
|
|
|
|
|
|
typedef GrDrawOp INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrPipelineDynamicStateTest, reporter, ctxInfo) {
|
2018-06-07 15:05:56 +00:00
|
|
|
GrContext* context = ctxInfo.grContext();
|
2019-02-04 18:26:26 +00:00
|
|
|
GrResourceProvider* rp = context->priv().resourceProvider();
|
2017-06-06 18:27:16 +00:00
|
|
|
|
2020-01-08 16:52:34 +00:00
|
|
|
auto rtc = GrRenderTargetContext::Make(
|
|
|
|
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
|
|
|
|
{kScreenSize, kScreenSize});
|
2017-06-06 18:27:16 +00:00
|
|
|
if (!rtc) {
|
|
|
|
ERRORF(reporter, "could not create render target context.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr float d = (float) kScreenSize;
|
|
|
|
Vertex vdata[kNumMeshes * 4] = {
|
|
|
|
{0, 0, kMeshColors[0]},
|
|
|
|
{0, d, kMeshColors[0]},
|
|
|
|
{d, 0, kMeshColors[0]},
|
|
|
|
{d, d, kMeshColors[0]},
|
|
|
|
|
|
|
|
{0, 0, kMeshColors[1]},
|
|
|
|
{0, d, kMeshColors[1]},
|
|
|
|
{d, 0, kMeshColors[1]},
|
|
|
|
{d, d, kMeshColors[1]},
|
|
|
|
|
|
|
|
{0, 0, kMeshColors[2]},
|
|
|
|
{0, d, kMeshColors[2]},
|
|
|
|
{d, 0, kMeshColors[2]},
|
|
|
|
{d, d, kMeshColors[2]},
|
|
|
|
|
|
|
|
{0, 0, kMeshColors[3]},
|
|
|
|
{0, d, kMeshColors[3]},
|
|
|
|
{d, 0, kMeshColors[3]},
|
|
|
|
{d, d, kMeshColors[3]}
|
|
|
|
};
|
|
|
|
|
2019-02-07 16:31:24 +00:00
|
|
|
sk_sp<const GrBuffer> vbuff(rp->createBuffer(sizeof(vdata), GrGpuBufferType::kVertex,
|
|
|
|
kDynamic_GrAccessPattern, vdata));
|
2017-06-06 18:27:16 +00:00
|
|
|
if (!vbuff) {
|
|
|
|
ERRORF(reporter, "vbuff is null.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t resultPx[kScreenSize * kScreenSize];
|
|
|
|
|
2018-08-15 06:53:25 +00:00
|
|
|
for (GrScissorTest scissorTest : {GrScissorTest::kEnabled, GrScissorTest::kDisabled}) {
|
2018-11-05 20:06:26 +00:00
|
|
|
rtc->clear(nullptr, SkPMColor4f::FromBytes_RGBA(0xbaaaaaad),
|
|
|
|
GrRenderTargetContext::CanClearFullscreen::kYes);
|
2017-06-06 18:27:16 +00:00
|
|
|
rtc->priv().testingOnly_addDrawOp(
|
2018-08-15 06:53:25 +00:00
|
|
|
GrPipelineDynamicStateTestOp::Make(context, scissorTest, vbuff));
|
2017-06-06 18:27:16 +00:00
|
|
|
rtc->readPixels(SkImageInfo::Make(kScreenSize, kScreenSize,
|
|
|
|
kRGBA_8888_SkColorType, kPremul_SkAlphaType),
|
2019-07-01 17:05:28 +00:00
|
|
|
resultPx, 4 * kScreenSize, {0, 0});
|
2017-06-06 18:27:16 +00:00
|
|
|
for (int y = 0; y < kScreenSize; ++y) {
|
|
|
|
for (int x = 0; x < kScreenSize; ++x) {
|
|
|
|
int expectedColorIdx;
|
2018-08-15 06:53:25 +00:00
|
|
|
if (GrScissorTest::kEnabled == scissorTest) {
|
2017-06-06 18:27:16 +00:00
|
|
|
expectedColorIdx = (x < kScreenSplitX ? 0 : 2) + (y < kScreenSplitY ? 0 : 1);
|
|
|
|
} else {
|
|
|
|
expectedColorIdx = kNumMeshes - 1;
|
|
|
|
}
|
|
|
|
uint32_t expected = kMeshColors[expectedColorIdx];
|
|
|
|
uint32_t actual = resultPx[y * kScreenSize + x];
|
|
|
|
if (expected != actual) {
|
|
|
|
ERRORF(reporter, "[scissor=%s] pixel (%i,%i): got 0x%x expected 0x%x",
|
2018-08-15 06:53:25 +00:00
|
|
|
GrScissorTest::kEnabled == scissorTest ? "enabled" : "disabled", x, y,
|
2017-06-06 18:27:16 +00:00
|
|
|
actual, expected);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|