2011-08-16 15:45:58 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2012-08-03 14:34:46 +00:00
|
|
|
// This is a GPU-backend specific test. It relies on static intializers to work
|
2012-08-02 14:03:32 +00:00
|
|
|
|
2012-08-03 14:54:45 +00:00
|
|
|
#include "SkTypes.h"
|
|
|
|
|
|
|
|
#if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
|
|
|
|
|
2015-03-16 21:00:52 +00:00
|
|
|
#include "GrAutoLocaleSetter.h"
|
2013-02-04 16:13:32 +00:00
|
|
|
#include "GrContextFactory.h"
|
2016-08-31 19:54:46 +00:00
|
|
|
#include "GrContextPriv.h"
|
2016-12-20 20:34:05 +00:00
|
|
|
#include "GrDrawOpTest.h"
|
2015-11-11 20:01:09 +00:00
|
|
|
#include "GrDrawingManager.h"
|
2014-11-12 16:35:25 +00:00
|
|
|
#include "GrInvariantOutput.h"
|
2015-01-22 18:16:09 +00:00
|
|
|
#include "GrPipeline.h"
|
2016-12-20 20:34:05 +00:00
|
|
|
#include "GrRenderTargetContextPriv.h"
|
2015-05-29 17:26:19 +00:00
|
|
|
#include "GrResourceProvider.h"
|
2014-11-06 20:57:13 +00:00
|
|
|
#include "GrTest.h"
|
2014-12-09 19:15:43 +00:00
|
|
|
#include "GrXferProcessor.h"
|
2013-05-22 14:34:04 +00:00
|
|
|
#include "SkChecksum.h"
|
2012-11-21 22:38:36 +00:00
|
|
|
#include "SkRandom.h"
|
2012-08-02 18:11:43 +00:00
|
|
|
#include "Test.h"
|
2015-08-07 18:42:16 +00:00
|
|
|
|
2016-12-16 14:52:16 +00:00
|
|
|
#include "ops/GrDrawOp.h"
|
2015-08-07 18:42:16 +00:00
|
|
|
|
2014-11-06 20:57:13 +00:00
|
|
|
#include "effects/GrConfigConversionEffect.h"
|
2014-12-09 19:15:43 +00:00
|
|
|
#include "effects/GrPorterDuffXferProcessor.h"
|
2015-09-10 13:57:05 +00:00
|
|
|
#include "effects/GrXfermodeFragmentProcessor.h"
|
2015-08-07 18:42:16 +00:00
|
|
|
|
2014-12-22 19:44:19 +00:00
|
|
|
#include "gl/GrGLGpu.h"
|
2015-11-13 14:54:19 +00:00
|
|
|
#include "glsl/GrGLSLFragmentProcessor.h"
|
2015-11-11 21:06:05 +00:00
|
|
|
#include "glsl/GrGLSLFragmentShaderBuilder.h"
|
|
|
|
#include "glsl/GrGLSLProgramBuilder.h"
|
2012-08-02 18:11:43 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
/*
|
2014-10-15 18:05:26 +00:00
|
|
|
* A dummy processor which just tries to insert a massive key and verify that it can retrieve the
|
2014-10-09 14:25:36 +00:00
|
|
|
* whole thing correctly
|
|
|
|
*/
|
|
|
|
static const uint32_t kMaxKeySize = 1024;
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2015-11-13 14:54:19 +00:00
|
|
|
class GLBigKeyProcessor : public GrGLSLFragmentProcessor {
|
2014-12-04 19:35:33 +00:00
|
|
|
public:
|
2016-02-03 20:25:40 +00:00
|
|
|
void emitCode(EmitArgs& args) override {
|
2015-05-13 15:51:49 +00:00
|
|
|
// pass through
|
2015-11-18 16:01:26 +00:00
|
|
|
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
|
2015-09-14 19:26:33 +00:00
|
|
|
if (args.fInputColor) {
|
2015-11-18 16:01:26 +00:00
|
|
|
fragBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputColor);
|
2015-09-14 19:26:33 +00:00
|
|
|
} else {
|
2015-11-18 16:01:26 +00:00
|
|
|
fragBuilder->codeAppendf("%s = vec4(1.0);\n", args.fOutputColor);
|
2015-09-14 19:26:33 +00:00
|
|
|
}
|
2015-05-13 15:51:49 +00:00
|
|
|
}
|
2014-12-04 19:35:33 +00:00
|
|
|
|
2016-11-29 18:43:05 +00:00
|
|
|
static void GenKey(const GrProcessor&, const GrShaderCaps&, GrProcessorKeyBuilder* b) {
|
2014-12-04 19:35:33 +00:00
|
|
|
for (uint32_t i = 0; i < kMaxKeySize; i++) {
|
|
|
|
b->add32(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2015-11-13 14:54:19 +00:00
|
|
|
typedef GrGLSLFragmentProcessor INHERITED;
|
2014-12-04 19:35:33 +00:00
|
|
|
};
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
class BigKeyProcessor : public GrFragmentProcessor {
|
|
|
|
public:
|
2016-06-09 15:01:03 +00:00
|
|
|
static sk_sp<GrFragmentProcessor> Make() {
|
|
|
|
return sk_sp<GrFragmentProcessor>(new BigKeyProcessor);
|
2014-10-07 15:37:36 +00:00
|
|
|
}
|
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
const char* name() const override { return "Big Ole Key"; }
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2015-11-13 19:57:27 +00:00
|
|
|
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
|
2016-02-03 20:25:40 +00:00
|
|
|
return new GLBigKeyProcessor;
|
2014-12-04 19:35:33 +00:00
|
|
|
}
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
private:
|
2014-12-04 19:35:33 +00:00
|
|
|
BigKeyProcessor() {
|
|
|
|
this->initClassID<BigKeyProcessor>();
|
|
|
|
}
|
2016-11-29 18:43:05 +00:00
|
|
|
virtual void onGetGLSLProcessorKey(const GrShaderCaps& caps,
|
2015-11-13 19:57:27 +00:00
|
|
|
GrProcessorKeyBuilder* b) const override {
|
2015-08-04 14:59:37 +00:00
|
|
|
GLBigKeyProcessor::GenKey(*this, caps, b);
|
|
|
|
}
|
2015-03-26 01:17:31 +00:00
|
|
|
bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
|
|
|
|
void onComputeInvariantOutput(GrInvariantOutput* inout) const override { }
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
typedef GrFragmentProcessor INHERITED;
|
|
|
|
};
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor);
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> BigKeyProcessor::TestCreate(GrProcessorTestData*) {
|
|
|
|
return BigKeyProcessor::Make();
|
2014-10-09 14:25:36 +00:00
|
|
|
}
|
2014-10-07 15:37:36 +00:00
|
|
|
|
2015-09-14 19:26:33 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class BlockInputFragmentProcessor : public GrFragmentProcessor {
|
|
|
|
public:
|
2016-06-09 15:01:03 +00:00
|
|
|
static sk_sp<GrFragmentProcessor> Make(sk_sp<GrFragmentProcessor> fp) {
|
|
|
|
return sk_sp<GrFragmentProcessor>(new BlockInputFragmentProcessor(fp));
|
2015-09-14 19:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const char* name() const override { return "Block Input"; }
|
|
|
|
|
2015-11-13 19:57:27 +00:00
|
|
|
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new GLFP; }
|
2015-09-14 19:26:33 +00:00
|
|
|
|
|
|
|
private:
|
2015-11-13 14:54:19 +00:00
|
|
|
class GLFP : public GrGLSLFragmentProcessor {
|
2015-09-14 19:26:33 +00:00
|
|
|
public:
|
|
|
|
void emitCode(EmitArgs& args) override {
|
2015-09-24 13:00:00 +00:00
|
|
|
this->emitChild(0, nullptr, args);
|
2015-09-14 19:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2015-11-13 14:54:19 +00:00
|
|
|
typedef GrGLSLFragmentProcessor INHERITED;
|
2015-09-14 19:26:33 +00:00
|
|
|
};
|
|
|
|
|
2016-06-09 15:01:03 +00:00
|
|
|
BlockInputFragmentProcessor(sk_sp<GrFragmentProcessor> child) {
|
2015-09-14 19:26:33 +00:00
|
|
|
this->initClassID<BlockInputFragmentProcessor>();
|
2016-06-09 15:01:03 +00:00
|
|
|
this->registerChildProcessor(std::move(child));
|
2015-09-14 19:26:33 +00:00
|
|
|
}
|
|
|
|
|
2016-11-29 18:43:05 +00:00
|
|
|
void onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override {}
|
2015-09-14 19:26:33 +00:00
|
|
|
|
|
|
|
bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
|
|
|
|
|
|
|
|
void onComputeInvariantOutput(GrInvariantOutput* inout) const override {
|
2017-01-23 19:35:25 +00:00
|
|
|
inout->setToOther(kRGBA_GrColorComponentFlags, GrColor_WHITE);
|
2015-09-14 19:26:33 +00:00
|
|
|
this->childProcessor(0).computeInvariantOutput(inout);
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef GrFragmentProcessor INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
/*
|
|
|
|
* Begin test code
|
|
|
|
*/
|
|
|
|
static const int kRenderTargetHeight = 1;
|
|
|
|
static const int kRenderTargetWidth = 1;
|
|
|
|
|
2016-10-27 18:47:55 +00:00
|
|
|
static sk_sp<GrRenderTargetContext> random_render_target_context(GrContext* context,
|
|
|
|
SkRandom* random,
|
|
|
|
const GrCaps* caps) {
|
2016-05-19 21:01:05 +00:00
|
|
|
GrSurfaceOrigin origin = random->nextBool() ? kTopLeft_GrSurfaceOrigin
|
|
|
|
: kBottomLeft_GrSurfaceOrigin;
|
|
|
|
int sampleCnt = random->nextBool() ? SkTMin(4, caps->maxSampleCount()) : 0;
|
2015-05-13 15:51:49 +00:00
|
|
|
|
2016-10-27 18:47:55 +00:00
|
|
|
sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContext(
|
|
|
|
SkBackingFit::kExact,
|
|
|
|
kRenderTargetWidth,
|
|
|
|
kRenderTargetHeight,
|
|
|
|
kRGBA_8888_GrPixelConfig,
|
|
|
|
nullptr,
|
|
|
|
sampleCnt,
|
|
|
|
origin));
|
|
|
|
return renderTargetContext;
|
2013-02-12 21:45:24 +00:00
|
|
|
}
|
|
|
|
|
2016-06-23 21:07:00 +00:00
|
|
|
static void set_random_xpf(GrPaint* paint, GrProcessorTestData* d) {
|
2017-01-09 16:46:10 +00:00
|
|
|
paint->setXPFactory(GrXPFactoryTestFactory::Get(d));
|
2014-12-11 21:15:13 +00:00
|
|
|
}
|
|
|
|
|
2016-06-09 15:01:03 +00:00
|
|
|
static sk_sp<GrFragmentProcessor> create_random_proc_tree(GrProcessorTestData* d,
|
|
|
|
int minLevels, int maxLevels) {
|
2015-09-10 13:57:05 +00:00
|
|
|
SkASSERT(1 <= minLevels);
|
|
|
|
SkASSERT(minLevels <= maxLevels);
|
|
|
|
|
|
|
|
// Return a leaf node if maxLevels is 1 or if we randomly chose to terminate.
|
|
|
|
// If returning a leaf node, make sure that it doesn't have children (e.g. another
|
|
|
|
// GrComposeEffect)
|
|
|
|
const float terminateProbability = 0.3f;
|
|
|
|
if (1 == minLevels) {
|
|
|
|
bool terminate = (1 == maxLevels) || (d->fRandom->nextF() < terminateProbability);
|
|
|
|
if (terminate) {
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> fp;
|
2015-09-10 13:57:05 +00:00
|
|
|
while (true) {
|
2016-06-09 15:01:03 +00:00
|
|
|
fp = GrProcessorTestFactory<GrFragmentProcessor>::Make(d);
|
2015-09-10 13:57:05 +00:00
|
|
|
SkASSERT(fp);
|
|
|
|
if (0 == fp->numChildProcessors()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// If we didn't terminate, choose either the left or right subtree to fulfill
|
|
|
|
// the minLevels requirement of this tree; the other child can have as few levels as it wants.
|
|
|
|
// Also choose a random xfer mode that's supported by CreateFrom2Procs().
|
|
|
|
if (minLevels > 1) {
|
|
|
|
--minLevels;
|
|
|
|
}
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> minLevelsChild(create_random_proc_tree(d, minLevels, maxLevels - 1));
|
|
|
|
sk_sp<GrFragmentProcessor> otherChild(create_random_proc_tree(d, 1, maxLevels - 1));
|
2016-10-28 19:42:34 +00:00
|
|
|
SkBlendMode mode = static_cast<SkBlendMode>(d->fRandom->nextRangeU(0,
|
|
|
|
(int)SkBlendMode::kLastCoeffMode));
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> fp;
|
2015-09-10 13:57:05 +00:00
|
|
|
if (d->fRandom->nextF() < 0.5f) {
|
2016-06-09 15:01:03 +00:00
|
|
|
fp = GrXfermodeFragmentProcessor::MakeFromTwoProcessors(std::move(minLevelsChild),
|
|
|
|
std::move(otherChild), mode);
|
2015-09-10 13:57:05 +00:00
|
|
|
SkASSERT(fp);
|
|
|
|
} else {
|
2016-06-09 15:01:03 +00:00
|
|
|
fp = GrXfermodeFragmentProcessor::MakeFromTwoProcessors(std::move(otherChild),
|
|
|
|
std::move(minLevelsChild), mode);
|
2015-09-10 13:57:05 +00:00
|
|
|
SkASSERT(fp);
|
|
|
|
}
|
|
|
|
return fp;
|
|
|
|
}
|
|
|
|
|
2016-06-23 21:07:00 +00:00
|
|
|
static void set_random_color_coverage_stages(GrPaint* paint,
|
|
|
|
GrProcessorTestData* d,
|
|
|
|
int maxStages) {
|
2015-09-10 13:57:05 +00:00
|
|
|
// Randomly choose to either create a linear pipeline of procs or create one proc tree
|
|
|
|
const float procTreeProbability = 0.5f;
|
|
|
|
if (d->fRandom->nextF() < procTreeProbability) {
|
|
|
|
// A full tree with 5 levels (31 nodes) may exceed the max allowed length of the gl
|
|
|
|
// processor key; maxTreeLevels should be a number from 1 to 4 inclusive.
|
|
|
|
const int maxTreeLevels = 4;
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> fp(create_random_proc_tree(d, 2, maxTreeLevels));
|
2016-06-23 21:07:00 +00:00
|
|
|
paint->addColorFragmentProcessor(std::move(fp));
|
2015-09-10 13:57:05 +00:00
|
|
|
} else {
|
|
|
|
int numProcs = d->fRandom->nextULessThan(maxStages + 1);
|
|
|
|
int numColorProcs = d->fRandom->nextULessThan(numProcs + 1);
|
|
|
|
|
|
|
|
for (int s = 0; s < numProcs;) {
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> fp(GrProcessorTestFactory<GrFragmentProcessor>::Make(d));
|
2015-09-10 13:57:05 +00:00
|
|
|
SkASSERT(fp);
|
|
|
|
|
|
|
|
// finally add the stage to the correct pipeline in the drawstate
|
|
|
|
if (s < numColorProcs) {
|
2016-06-23 21:07:00 +00:00
|
|
|
paint->addColorFragmentProcessor(std::move(fp));
|
2015-09-10 13:57:05 +00:00
|
|
|
} else {
|
2016-06-23 21:07:00 +00:00
|
|
|
paint->addCoverageFragmentProcessor(std::move(fp));
|
2015-09-10 13:57:05 +00:00
|
|
|
}
|
|
|
|
++s;
|
2014-10-09 14:25:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-23 21:07:00 +00:00
|
|
|
static bool set_random_state(GrPaint* paint, SkRandom* random) {
|
|
|
|
if (random->nextBool()) {
|
|
|
|
paint->setDisableOutputConversionToSRGB(true);
|
2014-10-09 14:25:36 +00:00
|
|
|
}
|
2016-06-23 21:07:00 +00:00
|
|
|
if (random->nextBool()) {
|
|
|
|
paint->setAllowSRGBInputs(true);
|
|
|
|
}
|
|
|
|
return random->nextBool();
|
2014-10-09 14:25:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// right now, the only thing we seem to care about in drawState's stencil is 'doesWrite()'
|
2016-06-23 21:07:00 +00:00
|
|
|
static const GrUserStencilSettings* get_random_stencil(SkRandom* random) {
|
2016-05-11 20:58:08 +00:00
|
|
|
static constexpr GrUserStencilSettings kDoesWriteStencil(
|
|
|
|
GrUserStencilSettings::StaticInit<
|
|
|
|
0xffff,
|
|
|
|
GrUserStencilTest::kAlways,
|
|
|
|
0xffff,
|
|
|
|
GrUserStencilOp::kReplace,
|
|
|
|
GrUserStencilOp::kReplace,
|
|
|
|
0xffff>()
|
|
|
|
);
|
|
|
|
static constexpr GrUserStencilSettings kDoesNotWriteStencil(
|
|
|
|
GrUserStencilSettings::StaticInit<
|
|
|
|
0xffff,
|
|
|
|
GrUserStencilTest::kNever,
|
|
|
|
0xffff,
|
|
|
|
GrUserStencilOp::kKeep,
|
|
|
|
GrUserStencilOp::kKeep,
|
|
|
|
0xffff>()
|
|
|
|
);
|
2014-10-09 14:25:36 +00:00
|
|
|
|
|
|
|
if (random->nextBool()) {
|
2016-06-23 21:07:00 +00:00
|
|
|
return &kDoesWriteStencil;
|
2014-10-09 14:25:36 +00:00
|
|
|
} else {
|
2016-06-23 21:07:00 +00:00
|
|
|
return &kDoesNotWriteStencil;
|
2014-10-09 14:25:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-16 14:23:31 +00:00
|
|
|
bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
|
2016-08-31 19:54:46 +00:00
|
|
|
GrDrawingManager* drawingManager = context->contextPriv().drawingManager();
|
2015-11-11 20:01:09 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
// setup dummy textures
|
2014-10-28 21:33:06 +00:00
|
|
|
GrSurfaceDesc dummyDesc;
|
2015-07-16 17:00:28 +00:00
|
|
|
dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag;
|
2016-10-14 13:16:21 +00:00
|
|
|
dummyDesc.fConfig = kRGBA_8888_GrPixelConfig;
|
2012-08-03 14:34:46 +00:00
|
|
|
dummyDesc.fWidth = 34;
|
|
|
|
dummyDesc.fHeight = 18;
|
2016-11-04 15:49:42 +00:00
|
|
|
sk_sp<GrTexture> dummyTexture1(
|
2016-02-25 16:33:02 +00:00
|
|
|
context->textureProvider()->createTexture(dummyDesc, SkBudgeted::kNo, nullptr, 0));
|
2014-10-28 21:33:06 +00:00
|
|
|
dummyDesc.fFlags = kNone_GrSurfaceFlags;
|
2012-08-03 14:34:46 +00:00
|
|
|
dummyDesc.fConfig = kAlpha_8_GrPixelConfig;
|
|
|
|
dummyDesc.fWidth = 16;
|
|
|
|
dummyDesc.fHeight = 22;
|
2016-11-04 15:49:42 +00:00
|
|
|
sk_sp<GrTexture> dummyTexture2(
|
2016-02-25 16:33:02 +00:00
|
|
|
context->textureProvider()->createTexture(dummyDesc, SkBudgeted::kNo, nullptr, 0));
|
2012-08-03 14:34:46 +00:00
|
|
|
|
2014-07-17 17:50:59 +00:00
|
|
|
if (!dummyTexture1 || ! dummyTexture2) {
|
2014-10-09 14:25:36 +00:00
|
|
|
SkDebugf("Could not allocate dummy textures");
|
2014-07-17 17:50:59 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
GrTexture* dummyTextures[] = {dummyTexture1.get(), dummyTexture2.get()};
|
2012-08-02 18:11:43 +00:00
|
|
|
|
2014-11-19 17:38:51 +00:00
|
|
|
// dummy scissor state
|
2014-12-17 21:43:13 +00:00
|
|
|
GrScissorState scissor;
|
2014-11-19 17:38:51 +00:00
|
|
|
|
2014-10-09 14:25:36 +00:00
|
|
|
SkRandom random;
|
2016-04-05 17:57:13 +00:00
|
|
|
static const int NUM_TESTS = 1024;
|
2015-05-13 15:51:49 +00:00
|
|
|
for (int t = 0; t < NUM_TESTS; t++) {
|
2014-10-09 14:25:36 +00:00
|
|
|
// setup random render target(can fail)
|
2016-10-27 18:47:55 +00:00
|
|
|
sk_sp<GrRenderTargetContext> renderTargetContext(random_render_target_context(
|
|
|
|
context, &random, context->caps()));
|
|
|
|
if (!renderTargetContext) {
|
|
|
|
SkDebugf("Could not allocate renderTargetContext");
|
2014-10-09 14:25:36 +00:00
|
|
|
return false;
|
|
|
|
}
|
2013-05-22 14:34:04 +00:00
|
|
|
|
2016-06-23 21:07:00 +00:00
|
|
|
GrPaint grPaint;
|
2013-05-22 14:34:04 +00:00
|
|
|
|
2017-01-03 14:42:58 +00:00
|
|
|
std::unique_ptr<GrDrawOp> op(GrRandomDrawOp(&random, context));
|
2016-12-09 21:07:12 +00:00
|
|
|
SkASSERT(op);
|
2014-09-22 20:17:02 +00:00
|
|
|
|
2017-01-25 19:58:24 +00:00
|
|
|
GrProcessorTestData ptd(&random, context, renderTargetContext.get(), dummyTextures);
|
2016-06-23 21:07:00 +00:00
|
|
|
set_random_color_coverage_stages(&grPaint, &ptd, maxStages);
|
|
|
|
set_random_xpf(&grPaint, &ptd);
|
|
|
|
bool snapToCenters = set_random_state(&grPaint, &random);
|
|
|
|
const GrUserStencilSettings* uss = get_random_stencil(&random);
|
2016-12-09 20:10:07 +00:00
|
|
|
// We don't use kHW because we will hit an assertion if the render target is not
|
|
|
|
// multisampled
|
|
|
|
static constexpr GrAAType kAATypes[] = {GrAAType::kNone, GrAAType::kCoverage};
|
|
|
|
GrAAType aaType = kAATypes[random.nextULessThan(SK_ARRAY_COUNT(kAATypes))];
|
2014-10-09 14:25:36 +00:00
|
|
|
|
2017-01-11 18:42:54 +00:00
|
|
|
renderTargetContext->priv().testingOnly_addDrawOp(std::move(grPaint), aaType, std::move(op),
|
|
|
|
uss, snapToCenters);
|
2012-08-02 18:11:43 +00:00
|
|
|
}
|
2015-05-13 15:51:49 +00:00
|
|
|
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)
|
2015-11-11 20:01:09 +00:00
|
|
|
drawingManager->flush();
|
2015-09-14 19:26:33 +00:00
|
|
|
|
|
|
|
// Validate that GrFPs work correctly without an input.
|
2016-10-27 18:47:55 +00:00
|
|
|
sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContext(
|
|
|
|
SkBackingFit::kExact,
|
|
|
|
kRenderTargetWidth,
|
|
|
|
kRenderTargetHeight,
|
|
|
|
kRGBA_8888_GrPixelConfig,
|
|
|
|
nullptr));
|
|
|
|
if (!renderTargetContext) {
|
|
|
|
SkDebugf("Could not allocate a renderTargetContext");
|
2016-05-19 21:01:05 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-09-14 19:26:33 +00:00
|
|
|
int fpFactoryCnt = GrProcessorTestFactory<GrFragmentProcessor>::Count();
|
|
|
|
for (int i = 0; i < fpFactoryCnt; ++i) {
|
|
|
|
// Since FP factories internally randomize, call each 10 times.
|
|
|
|
for (int j = 0; j < 10; ++j) {
|
2017-01-03 14:42:58 +00:00
|
|
|
std::unique_ptr<GrDrawOp> op(GrRandomDrawOp(&random, context));
|
2016-12-09 21:07:12 +00:00
|
|
|
SkASSERT(op);
|
2017-01-25 19:58:24 +00:00
|
|
|
GrProcessorTestData ptd(&random, context, renderTargetContext.get(), dummyTextures);
|
2016-06-23 21:07:00 +00:00
|
|
|
GrPaint grPaint;
|
2017-01-09 16:46:10 +00:00
|
|
|
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
|
2015-09-14 19:26:33 +00:00
|
|
|
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> fp(
|
|
|
|
GrProcessorTestFactory<GrFragmentProcessor>::MakeIdx(i, &ptd));
|
|
|
|
sk_sp<GrFragmentProcessor> blockFP(
|
|
|
|
BlockInputFragmentProcessor::Make(std::move(fp)));
|
2016-06-23 21:07:00 +00:00
|
|
|
grPaint.addColorFragmentProcessor(std::move(blockFP));
|
2015-09-14 19:26:33 +00:00
|
|
|
|
2017-01-11 18:42:54 +00:00
|
|
|
renderTargetContext->priv().testingOnly_addDrawOp(std::move(grPaint), GrAAType::kNone,
|
2016-12-09 21:07:12 +00:00
|
|
|
std::move(op));
|
2015-11-11 20:01:09 +00:00
|
|
|
drawingManager->flush();
|
2015-09-14 19:26:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-02 18:11:43 +00:00
|
|
|
return true;
|
|
|
|
}
|
2011-08-16 15:45:58 +00:00
|
|
|
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
static int get_glprograms_max_stages(GrContext* context) {
|
|
|
|
GrGLGpu* gpu = static_cast<GrGLGpu*>(context->getGpu());
|
|
|
|
/*
|
|
|
|
* For the time being, we only support the test with desktop GL or for android on
|
|
|
|
* ARM platforms
|
|
|
|
* TODO When we run ES 3.00 GLSL in more places, test again
|
|
|
|
*/
|
|
|
|
if (kGL_GrGLStandard == gpu->glStandard() ||
|
|
|
|
kARM_GrGLVendor == gpu->ctxInfo().vendor()) {
|
|
|
|
return 6;
|
|
|
|
} else if (kTegra3_GrGLRenderer == gpu->ctxInfo().renderer() ||
|
|
|
|
kOther_GrGLRenderer == gpu->ctxInfo().renderer()) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-04-05 19:59:06 +00:00
|
|
|
static void test_glprograms_native(skiatest::Reporter* reporter,
|
|
|
|
const sk_gpu_test::ContextInfo& ctxInfo) {
|
2016-05-11 13:33:06 +00:00
|
|
|
int maxStages = get_glprograms_max_stages(ctxInfo.grContext());
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
if (maxStages == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2016-05-11 13:33:06 +00:00
|
|
|
REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(ctxInfo.grContext(), maxStages));
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
}
|
|
|
|
|
2016-04-05 19:59:06 +00:00
|
|
|
static void test_glprograms_other_contexts(
|
|
|
|
skiatest::Reporter* reporter,
|
|
|
|
const sk_gpu_test::ContextInfo& ctxInfo) {
|
2016-05-11 13:33:06 +00:00
|
|
|
int maxStages = get_glprograms_max_stages(ctxInfo.grContext());
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
#ifdef SK_BUILD_FOR_WIN
|
|
|
|
// Some long shaders run out of temporary registers in the D3D compiler on ANGLE and
|
|
|
|
// command buffer.
|
|
|
|
maxStages = SkTMin(maxStages, 2);
|
|
|
|
#endif
|
|
|
|
if (maxStages == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2016-05-11 13:33:06 +00:00
|
|
|
REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(ctxInfo.grContext(), maxStages));
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
}
|
|
|
|
|
2016-04-06 21:02:39 +00:00
|
|
|
static bool is_native_gl_context_type(sk_gpu_test::GrContextFactory::ContextType type) {
|
|
|
|
return type == sk_gpu_test::GrContextFactory::kNativeGL_ContextType;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool is_other_rendering_gl_context_type(sk_gpu_test::GrContextFactory::ContextType type) {
|
|
|
|
return !is_native_gl_context_type(type) &&
|
|
|
|
kOpenGL_GrBackend == sk_gpu_test::GrContextFactory::ContextTypeBackend(type) &&
|
|
|
|
sk_gpu_test::GrContextFactory::IsRenderingContext(type);
|
|
|
|
}
|
|
|
|
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
DEF_GPUTEST(GLPrograms, reporter, /*factory*/) {
|
2015-03-16 18:56:29 +00:00
|
|
|
// Set a locale that would cause shader compilation to fail because of , as decimal separator.
|
|
|
|
// skbug 3330
|
|
|
|
#ifdef SK_BUILD_FOR_WIN
|
|
|
|
GrAutoLocaleSetter als("sv-SE");
|
|
|
|
#else
|
|
|
|
GrAutoLocaleSetter als("sv_SE.UTF-8");
|
|
|
|
#endif
|
|
|
|
|
2015-05-13 15:51:49 +00:00
|
|
|
// We suppress prints to avoid spew
|
2015-05-22 21:01:46 +00:00
|
|
|
GrContextOptions opts;
|
2015-05-13 15:51:49 +00:00
|
|
|
opts.fSuppressPrints = true;
|
2016-03-31 01:56:19 +00:00
|
|
|
sk_gpu_test::GrContextFactory debugFactory(opts);
|
2016-04-06 21:02:39 +00:00
|
|
|
skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_context_type,
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
reporter, &debugFactory);
|
|
|
|
skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts,
|
2016-04-06 21:02:39 +00:00
|
|
|
&is_other_rendering_gl_context_type, reporter, &debugFactory);
|
2011-08-16 15:45:58 +00:00
|
|
|
}
|
|
|
|
|
2012-08-02 14:03:32 +00:00
|
|
|
#endif
|