diff options
author | 2017-07-07 12:56:11 -0400 | |
---|---|---|
committer | 2017-07-07 20:47:38 +0000 | |
commit | 8fe24272fa6d2fa9eb2458221ed9852d6ec16f56 (patch) | |
tree | 85277ea7a49b36a18243768d7a2f27e44742aa84 /src/gpu/mock/GrMockTexture.h | |
parent | a531f2502846c4d4eed42b91589d70525c8de0d2 (diff) |
Add mock config to tools and run through gms and benchs without crashing.
Change-Id: I7e2474129ef2b15899ad2baeb8d18f39d05da98c
Reviewed-on: https://skia-review.googlesource.com/21820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/mock/GrMockTexture.h')
-rw-r--r-- | src/gpu/mock/GrMockTexture.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h index 41474c27f0..60682b3186 100644 --- a/src/gpu/mock/GrMockTexture.h +++ b/src/gpu/mock/GrMockTexture.h @@ -10,11 +10,13 @@ #include "GrMockGpu.h" #include "GrTexture.h" #include "GrTexturePriv.h" +#include "mock/GrMockTypes.h" class GrMockTexture : public GrTexture { public: - GrMockTexture(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc, bool hasMipLevels) - : GrMockTexture(gpu, desc, hasMipLevels) { + GrMockTexture(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc, bool hasMipLevels, + const GrMockTextureInfo& info) + : GrMockTexture(gpu, desc, hasMipLevels, info) { this->registerWithCache(budgeted); } ~GrMockTexture() override { @@ -22,7 +24,9 @@ public: fReleaseProc(fReleaseCtx); } } - GrBackendObject getTextureHandle() const override { return 0; } + GrBackendObject getTextureHandle() const override { + return reinterpret_cast<GrBackendObject>(&fInfo); + } void textureParamsModified() override {} void setRelease(ReleaseProc proc, ReleaseCtx ctx) override { fReleaseProc = proc; @@ -31,14 +35,17 @@ public: protected: // constructor for subclasses - GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, bool hasMipLevels) + GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, bool hasMipLevels, + const GrMockTextureInfo& info) : GrSurface(gpu, desc) , INHERITED(gpu, desc, kITexture2DSampler_GrSLType, GrSamplerParams::kMipMap_FilterMode, hasMipLevels) + , fInfo(info) , fReleaseProc(nullptr) , fReleaseCtx(nullptr) {} private: + GrMockTextureInfo fInfo; ReleaseProc fReleaseProc; ReleaseCtx fReleaseCtx; @@ -48,9 +55,9 @@ private: class GrMockTextureRenderTarget : public GrMockTexture, public GrRenderTarget { public: GrMockTextureRenderTarget(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc, - bool hasMipLevels) + bool hasMipLevels, const GrMockTextureInfo& texInfo) : GrSurface(gpu, desc) - , GrMockTexture(gpu, desc, hasMipLevels) + , GrMockTexture(gpu, desc, hasMipLevels, texInfo) , GrRenderTarget(gpu, desc) { this->registerWithCache(budgeted); } |