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

Unified Diff: src/gpu/gl/GrGLFragmentProcessor.h

Issue 1246193002: Moved GrGLFragmentProcessor definition to its own file (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 5 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 | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | src/gpu/gl/GrGLGpuProgramCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLFragmentProcessor.h
diff --git a/src/gpu/gl/GrGLProcessor.h b/src/gpu/gl/GrGLFragmentProcessor.h
similarity index 56%
copy from src/gpu/gl/GrGLProcessor.h
copy to src/gpu/gl/GrGLFragmentProcessor.h
index 017585d306828f7dd7990796cba587c6fc9cb52a..723806feab5dd6e6da43d632d575a952a8f51cd0 100644
--- a/src/gpu/gl/GrGLProcessor.h
+++ b/src/gpu/gl/GrGLFragmentProcessor.h
@@ -1,70 +1,17 @@
/*
- * Copyright 2012 Google Inc.
+ * 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 GrGLProcessor_DEFINED
-#define GrGLProcessor_DEFINED
+#ifndef GrGLFragmentProcessor_DEFINED
+#define GrGLFragmentProcessor_DEFINED
#include "GrGLProgramDataManager.h"
-#include "GrProcessor.h"
+#include "GrGLProcessor.h"
#include "GrTextureAccess.h"
-/** @file
- This file contains specializations for OpenGL of the shader stages declared in
- include/gpu/GrProcessor.h. Objects of type GrGLProcessor are responsible for emitting the
- GLSL code that implements a GrProcessor and for uploading uniforms at draw time. If they don't
- always emit the same GLSL code, they must have a function:
- static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*)
- that is used to implement a program cache. When two GrProcessors produce the same key this means
- that their GrGLProcessors would emit the same GLSL code.
-
- The GrGLProcessor subclass must also have a constructor of the form:
- ProcessorSubclass::ProcessorSubclass(const GrBackendProcessorFactory&, const GrProcessor&)
-
- These objects are created by the factory object returned by the GrProcessor::getFactory().
-*/
-// TODO delete this and make TextureSampler its own thing
-class GrGLProcessor {
-public:
- typedef GrGLProgramDataManager::UniformHandle UniformHandle;
-
- /**
- * Passed to GrGLProcessors so they can add transformed coordinates to their shader code.
- */
- typedef GrShaderVar TransformedCoords;
- typedef SkTArray<GrShaderVar> TransformedCoordsArray;
-
- /**
- * Passed to GrGLProcessors so they can add texture reads to their shader code.
- */
- class TextureSampler {
- public:
- TextureSampler(UniformHandle uniform, const GrTextureAccess& access)
- : fSamplerUniform(uniform)
- , fConfigComponentMask(GrPixelConfigComponentMask(access.getTexture()->config())) {
- SkASSERT(0 != fConfigComponentMask);
- memcpy(fSwizzle, access.getSwizzle(), 5);
- }
-
- // bitfield of GrColorComponentFlags present in the texture's config.
- uint32_t configComponentMask() const { return fConfigComponentMask; }
- // this is .abcd
- const char* swizzle() const { return fSwizzle; }
-
- private:
- UniformHandle fSamplerUniform;
- uint32_t fConfigComponentMask;
- char fSwizzle[5];
-
- friend class GrGLShaderBuilder;
- };
-
- typedef SkTArray<TextureSampler> TextureSamplerArray;
-};
-
class GrGLFPBuilder;
class GrGLFragmentProcessor {
« no previous file with comments | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | src/gpu/gl/GrGLGpuProgramCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698