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

Unified Diff: include/gpu/GrProcessorUnitTest.h

Issue 1334273003: Add helper for creating leaf FPs inside GrFP::TestCreate functions (Closed) Base URL: https://skia.googlesource.com/skia.git@noinputtest
Patch Set: address comment Created 5 years, 3 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 | « gyp/gpu.gypi ('k') | include/gpu/effects/GrExtractAlphaFragmentProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrProcessorUnitTest.h
diff --git a/include/gpu/GrProcessorUnitTest.h b/include/gpu/GrProcessorUnitTest.h
index 8a17521bfce2bfd6f92f77c992301759de70285f..b18c7072fdd38a0d2048bfcecb719d5270480d9d 100644
--- a/include/gpu/GrProcessorUnitTest.h
+++ b/include/gpu/GrProcessorUnitTest.h
@@ -15,14 +15,20 @@
class SkMatrix;
class GrCaps;
class GrContext;
+struct GrProcessorTestData;
namespace GrProcessorUnitTest {
+
// Used to access the dummy textures in TestCreate procs.
enum {
kSkiaPMTextureIdx = 0,
kAlphaTextureIdx = 1,
};
+/** This allows parent FPs to implement a test create with known leaf children in order to avoid
+creating an unbounded FP tree which may overflow various shader limits. */
+const GrFragmentProcessor* CreateChildFP(GrProcessorTestData*);
+
}
/*
@@ -57,10 +63,8 @@ struct GrProcessorTestData {
class GrProcessor;
class GrTexture;
-template <class Processor>
-class GrProcessorTestFactory : SkNoncopyable {
+template <class Processor> class GrProcessorTestFactory : SkNoncopyable {
public:
-
typedef const Processor* (*CreateProc)(GrProcessorTestData*);
GrProcessorTestFactory(CreateProc createProc) {
@@ -111,7 +115,6 @@ private:
static GrProcessorTestFactory<GrXPFactory> gTestFactory SK_UNUSED; \
static const GrXPFactory* TestCreate(GrProcessorTestData*)
-
/** GrProcessor subclasses should insert this macro in their implementation file. They must then
* also implement this static function:
* GrProcessor* TestCreate(GrProcessorTestData*);
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/effects/GrExtractAlphaFragmentProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698