Move textureType() method from GrSurfaceProxy to GrTextureProxy.

Change-Id: I5cf84210132838bdbf95209dc94210483762a450
Reviewed-on: https://skia-review.googlesource.com/c/175998
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Brian Salomon 2018-12-10 13:40:07 -05:00 committed by Skia Commit-Bot
parent 3d6b438b99
commit 7da2fc7857
7 changed files with 9 additions and 9 deletions

View File

@ -267,8 +267,6 @@ public:
const GrBackendFormat& backendFormat() const { return fFormat; }
GrTextureType textureType() const { return fFormat.textureType(); }
class UniqueID {
public:
static UniqueID InvalidID() {

View File

@ -40,6 +40,8 @@ public:
// been instantiated or not.
GrMipMapped proxyMipMapped() const { return fMipMapped; }
GrTextureType textureType() const { return this->backendFormat().textureType(); }
/** If true then the texture does not support MIP maps and only supports clamp wrap mode. */
bool hasRestrictedSampling() const {
return GrTextureTypeHasRestrictedSampling(this->textureType());

View File

@ -597,7 +597,7 @@ void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
void GrGLDisplacementMapEffect::onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& proc) {
const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMapEffect>();
GrSurfaceProxy* proxy = displacementMap.textureSampler(1).proxy();
GrTextureProxy* proxy = displacementMap.textureSampler(1).proxy();
GrTexture* colorTex = proxy->peekTexture();
SkScalar scaleX = displacementMap.scale().fX / colorTex->width();

View File

@ -106,7 +106,7 @@ void GrGLBicubicEffect::emitCode(EmitArgs& args) {
void GrGLBicubicEffect::onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& processor) {
const GrBicubicEffect& bicubicEffect = processor.cast<GrBicubicEffect>();
GrSurfaceProxy* proxy = processor.textureSampler(0).proxy();
GrTextureProxy* proxy = processor.textureSampler(0).proxy();
GrTexture* texture = proxy->peekTexture();
float imageIncrement[2];

View File

@ -125,7 +125,7 @@ void GrGLMatrixConvolutionEffect::GenKey(const GrProcessor& processor,
void GrGLMatrixConvolutionEffect::onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& processor) {
const GrMatrixConvolutionEffect& conv = processor.cast<GrMatrixConvolutionEffect>();
GrSurfaceProxy* proxy = conv.textureSampler(0).proxy();
GrTextureProxy* proxy = conv.textureSampler(0).proxy();
GrTexture* texture = proxy->peekTexture();
float imageIncrement[2];

View File

@ -161,7 +161,7 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman,
const GrTextureDomain& textureDomain,
GrSurfaceProxy* proxy) {
GrTextureProxy* proxy) {
GrTexture* tex = proxy->peekTexture();
SkASSERT(fHasMode && textureDomain.mode() == fMode);
if (kIgnore_Mode != textureDomain.mode()) {
@ -291,7 +291,7 @@ GrGLSLFragmentProcessor* GrTextureDomainEffect::onCreateGLSLInstance() const {
const GrFragmentProcessor& fp) override {
const GrTextureDomainEffect& tde = fp.cast<GrTextureDomainEffect>();
const GrTextureDomain& domain = tde.fTextureDomain;
GrSurfaceProxy* proxy = tde.textureSampler(0).proxy();
GrTextureProxy* proxy = tde.textureSampler(0).proxy();
fGLDomain.setData(pdman, domain, proxy);
}
@ -397,7 +397,7 @@ GrGLSLFragmentProcessor* GrDeviceSpaceTextureDecalFragmentProcessor::onCreateGLS
const GrFragmentProcessor& fp) override {
const GrDeviceSpaceTextureDecalFragmentProcessor& dstdfp =
fp.cast<GrDeviceSpaceTextureDecalFragmentProcessor>();
GrSurfaceProxy* proxy = dstdfp.textureSampler(0).proxy();
GrTextureProxy* proxy = dstdfp.textureSampler(0).proxy();
GrTexture* texture = proxy->peekTexture();
fGLDomain.setData(pdman, dstdfp.fTextureDomain, proxy);

View File

@ -115,7 +115,7 @@ public:
* texture domain. The rectangle is automatically adjusted to account for the texture's
* origin.
*/
void setData(const GrGLSLProgramDataManager&, const GrTextureDomain&, GrSurfaceProxy*);
void setData(const GrGLSLProgramDataManager&, const GrTextureDomain&, GrTextureProxy*);
enum {
kDomainKeyBits = 2, // See DomainKey().