Store the dst texture used by an XP in GrPipeline rather than in the XP.
This will allow the XP to be created before the dst texture.
Change-Id: I3e5bdfa8e5d47e58a3560792ce5cf3899d30a024
Reviewed-on: https://skia-review.googlesource.com/11011
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.h b/src/gpu/glsl/GrGLSLXferProcessor.h
index b4bde37..791bb06 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.h
+++ b/src/gpu/glsl/GrGLSLXferProcessor.h
@@ -8,6 +8,7 @@
#ifndef GrGLSLXferProcessor_DEFINED
#define GrGLSLXferProcessor_DEFINED
+#include "SkPoint.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLUniformHandler.h"
@@ -15,14 +16,15 @@
class GrGLSLXPBuilder;
class GrGLSLXPFragmentBuilder;
class GrShaderCaps;
+class GrTexture;
class GrGLSLXferProcessor {
public:
GrGLSLXferProcessor() {}
virtual ~GrGLSLXferProcessor() {}
- using SamplerHandle = GrGLSLUniformHandler::SamplerHandle;
- using ImageStorageHandle = GrGLSLUniformHandler::ImageStorageHandle;
+ using SamplerHandle = GrGLSLUniformHandler::SamplerHandle;
+ using ImageStorageHandle = GrGLSLUniformHandler::ImageStorageHandle;
struct EmitArgs {
EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder,
@@ -33,9 +35,8 @@
const char* inputCoverage,
const char* outputPrimary,
const char* outputSecondary,
- const SamplerHandle* texSamplers,
- const SamplerHandle* bufferSamplers,
- const ImageStorageHandle* imageStorages)
+ const SamplerHandle dstTextureSamplerHandle,
+ GrSurfaceOrigin dstTextureOrigin)
: fXPFragBuilder(fragBuilder)
, fUniformHandler(uniformHandler)
, fShaderCaps(caps)
@@ -44,10 +45,8 @@
, fInputCoverage(inputCoverage)
, fOutputPrimary(outputPrimary)
, fOutputSecondary(outputSecondary)
- , fTexSamplers(texSamplers)
- , fBufferSamplers(bufferSamplers)
- , fImageStorages(imageStorages) {}
-
+ , fDstTextureSamplerHandle(dstTextureSamplerHandle)
+ , fDstTextureOrigin(dstTextureOrigin) {}
GrGLSLXPFragmentBuilder* fXPFragBuilder;
GrGLSLUniformHandler* fUniformHandler;
const GrShaderCaps* fShaderCaps;
@@ -56,9 +55,8 @@
const char* fInputCoverage;
const char* fOutputPrimary;
const char* fOutputSecondary;
- const SamplerHandle* fTexSamplers;
- const SamplerHandle* fBufferSamplers;
- const ImageStorageHandle* fImageStorages;
+ const SamplerHandle fDstTextureSamplerHandle;
+ GrSurfaceOrigin fDstTextureOrigin;
};
/**
* This is similar to emitCode() in the base class, except it takes a full shader builder.
@@ -73,7 +71,8 @@
to have an identical processor key as the one that created this GrGLSLXferProcessor. This
function calls onSetData on the subclass of GrGLSLXferProcessor
*/
- void setData(const GrGLSLProgramDataManager& pdm, const GrXferProcessor& xp);
+ void setData(const GrGLSLProgramDataManager& pdm, const GrXferProcessor& xp,
+ const GrTexture* dstTexture, const SkIPoint& dstTextureOffset);
protected:
static void DefaultCoverageModulation(GrGLSLXPFragmentBuilder* fragBuilder,