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

Unified Diff: include/gpu/GrTBackendProcessorFactory.h

Issue 774133003: Revert of create and thread batch tracker object (Closed) Base URL: https://skia.googlesource.com/skia.git@2_vertex_attr
Patch Set: Created 6 years 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 | « include/gpu/GrBackendProcessorFactory.h ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTBackendProcessorFactory.h
diff --git a/include/gpu/GrTBackendProcessorFactory.h b/include/gpu/GrTBackendProcessorFactory.h
index 98b5d6cb7e89239a18576a1fe6544507a304d82d..a86fe38d92ea40367c9f78009e44579bc4a358ed 100644
--- a/include/gpu/GrTBackendProcessorFactory.h
+++ b/include/gpu/GrTBackendProcessorFactory.h
@@ -41,6 +41,14 @@
* described in this class's comment. */
virtual const char* name() const SK_OVERRIDE { return ProcessorClass::Name(); }
+
+ /** Implemented using GLProcessor::GenKey as described in this class's comment. */
+ virtual void getGLProcessorKey(const GrProcessor& processor,
+ const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const SK_OVERRIDE {
+ GLProcessor::GenKey(processor, caps, b);
+ }
+
/** Returns a new instance of the appropriate *GL* implementation class
for the given GrProcessor; caller is responsible for deleting
the object. */
@@ -69,80 +77,24 @@
* typesafe and does not require any casting.
*/
template <class ProcessorClass>
-class GrTBackendGeometryProcessorFactory : public GrBackendGeometryProcessorFactory {
-public:
- typedef typename ProcessorClass::GLProcessor GLProcessor;
-
- /** Returns a human-readable name for the processor. Implemented using GLProcessor::Name as
- * described in this class's comment. */
- virtual const char* name() const SK_OVERRIDE { return ProcessorClass::Name(); }
-
- /** Implemented using GLProcessor::GenKey as described in this class's comment. */
- virtual void getGLProcessorKey(const GrGeometryProcessor& processor,
- const GrBatchTracker& bt,
- const GrGLCaps& caps,
- GrProcessorKeyBuilder* b) const SK_OVERRIDE {
- GLProcessor::GenKey(processor, bt, caps, b);
- }
-
-
- /** Returns a new instance of the appropriate *GL* implementation class
- for the given GrProcessor; caller is responsible for deleting
- the object. */
- virtual GrGLGeometryProcessor* createGLInstance(const GrGeometryProcessor& gp,
- const GrBatchTracker& bt) const SK_OVERRIDE {
- return SkNEW_ARGS(GLProcessor, (*this, gp, bt));
- }
-
- /** This class is a singleton. This function returns the single instance. */
- static const GrBackendGeometryProcessorFactory& getInstance() {
- static SkAlignedSTStorage<1, GrTBackendGeometryProcessorFactory> gInstanceMem;
- static const GrTBackendGeometryProcessorFactory* gInstance;
- if (!gInstance) {
- gInstance = SkNEW_PLACEMENT(gInstanceMem.get(),
- GrTBackendGeometryProcessorFactory);
- }
- return *gInstance;
- }
+class GrTBackendGeometryProcessorFactory
+ : public GrTBackendProcessorFactory<ProcessorClass,
+ GrBackendGeometryProcessorFactory,
+ GrGeometryProcessor,
+ GrGLGeometryProcessor> {
protected:
GrTBackendGeometryProcessorFactory() {}
};
template <class ProcessorClass>
-class GrTBackendFragmentProcessorFactory : public GrBackendFragmentProcessorFactory {
-public:
- typedef typename ProcessorClass::GLProcessor GLProcessor;
-
- /** Returns a human-readable name for the processor. Implemented using GLProcessor::Name as
- * described in this class's comment. */
- virtual const char* name() const SK_OVERRIDE { return ProcessorClass::Name(); }
-
- /** Implemented using GLProcessor::GenKey as described in this class's comment. */
- virtual void getGLProcessorKey(const GrFragmentProcessor& processor,
- const GrGLCaps& caps,
- GrProcessorKeyBuilder* b) const SK_OVERRIDE {
- GLProcessor::GenKey(processor, caps, b);
- }
-
- /** Returns a new instance of the appropriate *GL* implementation class
- for the given GrProcessor; caller is responsible for deleting
- the object. */
- virtual GrGLFragmentProcessor* createGLInstance(const GrFragmentProcessor& gp) const SK_OVERRIDE {
- return SkNEW_ARGS(GLProcessor, (*this, gp));
- }
-
- /** This class is a singleton. This function returns the single instance. */
- static const GrBackendFragmentProcessorFactory& getInstance() {
- static SkAlignedSTStorage<1, GrTBackendFragmentProcessorFactory> gInstanceMem;
- static const GrTBackendFragmentProcessorFactory* gInstance;
- if (!gInstance) {
- gInstance = SkNEW_PLACEMENT(gInstanceMem.get(),
- GrTBackendFragmentProcessorFactory);
- }
- return *gInstance;
- }
+class GrTBackendFragmentProcessorFactory
+ : public GrTBackendProcessorFactory<ProcessorClass,
+ GrBackendFragmentProcessorFactory,
+ GrFragmentProcessor,
+ GrGLFragmentProcessor> {
protected:
GrTBackendFragmentProcessorFactory() {}
};
+
#endif
« no previous file with comments | « include/gpu/GrBackendProcessorFactory.h ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698