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

Unified Diff: include/gpu/GrGeometryProcessor.h

Issue 739943003: move GrGeometryProcessor to src (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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') | src/gpu/GrGeometryProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGeometryProcessor.h
diff --git a/include/gpu/GrGeometryProcessor.h b/include/gpu/GrGeometryProcessor.h
deleted file mode 100644
index 01401ae79704e7dd80ee8b9fd661e0b166e332ec..0000000000000000000000000000000000000000
--- a/include/gpu/GrGeometryProcessor.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrGeometryProcessor_DEFINED
-#define GrGeometryProcessor_DEFINED
-
-#include "GrProcessor.h"
-#include "GrShaderVar.h"
-
-/**
- * A GrGeomteryProcessor is used to perform computation in the vertex shader and
- * add support for custom vertex attributes. A GrGemeotryProcessor is typically
- * tied to the code that does a specific type of high-level primitive rendering
- * (e.g. anti-aliased circle rendering). The GrGeometryProcessor used for a draw is
- * specified using GrDrawState. There can only be one geometry processor active for
- * a draw. The custom vertex attributes required by the geometry processor must be
- * added to the vertex attribute array specified on the GrDrawState.
- * GrGeometryProcessor subclasses should be immutable after construction.
- */
-class GrGeometryProcessor : public GrProcessor {
-public:
- GrGeometryProcessor()
- : fWillUseGeoShader(false) {}
-
- virtual const GrBackendGeometryProcessorFactory& getFactory() const = 0;
-
- /*
- * This only has a max because GLProgramsTest needs to generate test arrays, and these have to
- * be static
- * TODO make this truly dynamic
- */
- static const int kMaxVertexAttribs = 2;
- typedef SkTArray<GrShaderVar, true> VertexAttribArray;
-
- const VertexAttribArray& getVertexAttribs() const { return fVertexAttribs; }
-
- bool willUseGeoShader() const { return fWillUseGeoShader; }
-
- /** Returns true if this and other processor conservatively draw identically. It can only return
- true when the two prcoessors are of the same subclass (i.e. they return the same object from
- from getFactory()).
- A return value of true from isEqual() should not be used to test whether the processors
- would generate the same shader code. To test for identical code generation use the
- processors' keys computed by the GrBackendEffectFactory. */
- bool isEqual(const GrGeometryProcessor& that) const {
- if (&this->getFactory() != &that.getFactory() || !this->hasSameTextureAccesses(that)) {
- return false;
- }
- return this->onIsEqual(that);
- }
-
-protected:
- /**
- * Subclasses call this from their constructor to register vertex attributes (at most
- * kMaxVertexAttribs). This must only be called from the constructor because GrProcessors are
- * immutable.
- */
- const GrShaderVar& addVertexAttrib(const GrShaderVar& var) {
- SkASSERT(fVertexAttribs.count() < kMaxVertexAttribs);
- return fVertexAttribs.push_back(var);
- }
-
- void setWillUseGeoShader() { fWillUseGeoShader = true; }
-
-private:
- virtual bool onIsEqual(const GrGeometryProcessor&) const = 0;
-
- SkSTArray<kMaxVertexAttribs, GrShaderVar, true> fVertexAttribs;
- bool fWillUseGeoShader;
-
- typedef GrProcessor INHERITED;
-};
-
-#endif
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698