diff --git a/gn/gpu.gni b/gn/gpu.gni index 2264e31737..8d41c0fb6a 100644 --- a/gn/gpu.gni +++ b/gn/gpu.gni @@ -238,7 +238,6 @@ skia_gpu_sources = [ "$_src/gpu/GrTextureAdjuster.h", "$_src/gpu/GrTextureMaker.cpp", "$_src/gpu/GrTextureMaker.h", - "$_src/gpu/GrTexturePriv.h", "$_src/gpu/GrTextureProducer.cpp", "$_src/gpu/GrTextureProducer.h", "$_src/gpu/GrTextureProxy.cpp", diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp index de8a3ecea6..ac352fc91c 100644 --- a/src/gpu/GrBackendTextureImageGenerator.cpp +++ b/src/gpu/GrBackendTextureImageGenerator.cpp @@ -19,7 +19,6 @@ #include "src/gpu/GrResourceProviderPriv.h" #include "src/gpu/GrSemaphore.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxyPriv.h" #include "src/gpu/SkGr.h" #include "src/gpu/gl/GrGLTexture.h" diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index 67f337381a..5677f299b2 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -30,7 +30,6 @@ #include "src/gpu/GrSurfaceContext.h" #include "src/gpu/GrSurfaceProxyPriv.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxy.h" #include "src/gpu/GrTextureProxyPriv.h" #include "src/gpu/GrTextureResolveRenderTask.h" diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 29c0fd1d6c..ece5d1eaeb 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -31,7 +31,6 @@ #include "src/gpu/GrStencilAttachment.h" #include "src/gpu/GrStencilSettings.h" #include "src/gpu/GrSurfacePriv.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxyPriv.h" #include "src/gpu/GrTracing.h" #include "src/utils/SkJSONWriter.h" @@ -159,7 +158,7 @@ sk_sp GrGpu::createTexture(SkISize dimensions, auto tex = this->createTextureCommon(dimensions, format, renderable, renderTargetSampleCnt, budgeted, isProtected, mipLevelCount, levelClearMask); if (tex && mipMapped == GrMipmapped::kYes && levelClearMask) { - tex->texturePriv().markMipmapsClean(); + tex->markMipmapsClean(); } return tex; } @@ -215,7 +214,7 @@ sk_sp GrGpu::createTexture(SkISize dimensions, markMipLevelsClean = true; } if (markMipLevelsClean) { - tex->texturePriv().markMipmapsClean(); + tex->markMipmapsClean(); } } return tex; @@ -552,8 +551,8 @@ bool GrGpu::regenerateMipMapLevels(GrTexture* texture) { TRACE_EVENT0("skia.gpu", TRACE_FUNC); SkASSERT(texture); SkASSERT(this->caps()->mipmapSupport()); - SkASSERT(texture->texturePriv().mipmapped() == GrMipmapped::kYes); - if (!texture->texturePriv().mipmapsAreDirty()) { + SkASSERT(texture->mipmapped() == GrMipmapped::kYes); + if (!texture->mipmapsAreDirty()) { // This can happen when the proxy expects mipmaps to be dirty, but they are not dirty on the // actual target. This may be caused by things that the drawingManager could not predict, // i.e., ops that don't draw anything, aborting a draw for exceptional circumstances, etc. @@ -564,7 +563,7 @@ bool GrGpu::regenerateMipMapLevels(GrTexture* texture) { return false; } if (this->onRegenerateMipMapLevels(texture)) { - texture->texturePriv().markMipmapsClean(); + texture->markMipmapsClean(); return true; } return false; @@ -589,7 +588,7 @@ void GrGpu::didWriteToSurface(GrSurface* surface, GrSurfaceOrigin origin, const if (nullptr == bounds || !bounds->isEmpty()) { GrTexture* texture = surface->asTexture(); if (texture && 1 == mipLevels) { - texture->texturePriv().markMipmapsDirty(); + texture->markMipmapsDirty(); } } } diff --git a/src/gpu/GrOpsRenderPass.cpp b/src/gpu/GrOpsRenderPass.cpp index 8b1cbd174a..51c8926318 100644 --- a/src/gpu/GrOpsRenderPass.cpp +++ b/src/gpu/GrOpsRenderPass.cpp @@ -17,7 +17,7 @@ #include "src/gpu/GrRenderTargetPriv.h" #include "src/gpu/GrScissorState.h" #include "src/gpu/GrSimpleMesh.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" void GrOpsRenderPass::begin() { fDrawPipelineStatus = DrawPipelineStatus::kNotConfigured; @@ -162,8 +162,7 @@ void GrOpsRenderPass::bindTextures(const GrPrimitiveProcessor& primProc, (tex->width() != 1 || tex->height() != 1)) { // There are some cases where we might be given a non-mipmapped texture with a mipmap // filter. See skbug.com/7094. - SkASSERT(tex->texturePriv().mipmapped() != GrMipmapped::kYes || - !tex->texturePriv().mipmapsAreDirty()); + SkASSERT(tex->mipmapped() != GrMipmapped::kYes || !tex->mipmapsAreDirty()); } } #endif diff --git a/src/gpu/GrOpsTask.cpp b/src/gpu/GrOpsTask.cpp index 9630914928..24cc7fdfb2 100644 --- a/src/gpu/GrOpsTask.cpp +++ b/src/gpu/GrOpsTask.cpp @@ -23,7 +23,7 @@ #include "src/gpu/GrRenderTargetPriv.h" #include "src/gpu/GrResourceAllocator.h" #include "src/gpu/GrStencilAttachment.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/geometry/GrRect.h" #include "src/gpu/ops/GrClearOp.h" diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp index 6c5be18107..694473d0e2 100644 --- a/src/gpu/GrProgramDesc.cpp +++ b/src/gpu/GrProgramDesc.cpp @@ -15,7 +15,7 @@ #include "src/gpu/GrProgramInfo.h" #include "src/gpu/GrRenderTargetPriv.h" #include "src/gpu/GrShaderCaps.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" diff --git a/src/gpu/GrProgramInfo.cpp b/src/gpu/GrProgramInfo.cpp index 1e57d4f9ac..9256fff3ad 100644 --- a/src/gpu/GrProgramInfo.cpp +++ b/src/gpu/GrProgramInfo.cpp @@ -22,7 +22,7 @@ GrStencilSettings GrProgramInfo::nonGLStencilSettings() const { } #ifdef SK_DEBUG -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" void GrProgramInfo::validate(bool flushTime) const { if (flushTime) { @@ -47,8 +47,7 @@ void GrProgramInfo::checkMSAAAndMIPSAreResolved() const { (tex->width() != 1 || tex->height() != 1)) { // There are some cases where we might be given a non-mipmapped texture with a // mipmap filter. See skbug.com/7094. - SkASSERT(tex->texturePriv().mipmapped() != GrMipmapped::kYes || - !tex->texturePriv().mipmapsAreDirty()); + SkASSERT(tex->mipmapped() != GrMipmapped::kYes || !tex->mipmapsAreDirty()); } }); } diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp index 64e9e5aa18..fd6bc98987 100644 --- a/src/gpu/GrResourceProvider.cpp +++ b/src/gpu/GrResourceProvider.cpp @@ -24,7 +24,7 @@ #include "src/gpu/GrResourceCache.h" #include "src/gpu/GrSemaphore.h" #include "src/gpu/GrStencilAttachment.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/SkGr.h" const int GrResourceProvider::kMinScratchTextureSize = 16; @@ -263,8 +263,8 @@ sk_sp GrResourceProvider::refScratchTexture(SkISize dimensions, // to fall back to making a new texture. if (fGpu->caps()->reuseScratchTextures() || renderable == GrRenderable::kYes) { GrScratchKey key; - GrTexturePriv::ComputeScratchKey(*this->caps(), format, dimensions, renderable, - renderTargetSampleCnt, mipMapped, isProtected, &key); + GrTexture::ComputeScratchKey(*this->caps(), format, dimensions, renderable, + renderTargetSampleCnt, mipMapped, isProtected, &key); GrGpuResource* resource = fCache->findAndRefScratchResource(key); if (resource) { fGpu->stats()->incNumScratchTexturesReused(); diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 63fe196140..c9de4393f2 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -20,7 +20,7 @@ #include "src/gpu/GrRenderTargetContext.h" #include "src/gpu/GrStencilAttachment.h" #include "src/gpu/GrSurfacePriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/GrTextureRenderTargetProxy.h" #ifdef SK_DEBUG @@ -212,8 +212,8 @@ void GrSurfaceProxy::computeScratchKey(const GrCaps& caps, GrScratchKey* key) co mipMapped = tp->mipmapped(); } - GrTexturePriv::ComputeScratchKey(caps, this->backendFormat(), this->backingStoreDimensions(), - renderable, sampleCount, mipMapped, fIsProtected, key); + GrTexture::ComputeScratchKey(caps, this->backendFormat(), this->backingStoreDimensions(), + renderable, sampleCount, mipMapped, fIsProtected, key); } SkISize GrSurfaceProxy::backingStoreDimensions() const { diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index fa8d93bb66..cab0492c7e 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -15,7 +15,6 @@ #include "src/gpu/GrRenderTarget.h" #include "src/gpu/GrSurfacePriv.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #ifdef SK_DEBUG #include "include/gpu/GrDirectContext.h" @@ -36,7 +35,7 @@ void GrTexture::markMipmapsClean() { size_t GrTexture::onGpuMemorySize() const { const GrCaps& caps = *this->getGpu()->caps(); return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), 1, - this->texturePriv().mipmapped()); + this->mipmapped()); } ///////////////////////////////////////////////////////////////////////////// @@ -94,20 +93,19 @@ void GrTexture::computeScratchKey(GrScratchKey* key) const { renderable = GrRenderable::kYes; } auto isProtected = this->isProtected() ? GrProtected::kYes : GrProtected::kNo; - GrTexturePriv::ComputeScratchKey(*this->getGpu()->caps(), this->backendFormat(), - this->dimensions(), renderable, sampleCount, - this->texturePriv().mipmapped(), isProtected, key); + ComputeScratchKey(*this->getGpu()->caps(), this->backendFormat(), this->dimensions(), + renderable, sampleCount, this->mipmapped(), isProtected, key); } } -void GrTexturePriv::ComputeScratchKey(const GrCaps& caps, - const GrBackendFormat& format, - SkISize dimensions, - GrRenderable renderable, - int sampleCnt, - GrMipmapped mipMapped, - GrProtected isProtected, - GrScratchKey* key) { +void GrTexture::ComputeScratchKey(const GrCaps& caps, + const GrBackendFormat& format, + SkISize dimensions, + GrRenderable renderable, + int sampleCnt, + GrMipmapped mipMapped, + GrProtected isProtected, + GrScratchKey* key) { static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType(); SkASSERT(!dimensions.isEmpty()); SkASSERT(sampleCnt > 0); diff --git a/src/gpu/GrTexture.h b/src/gpu/GrTexture.h index 678ed82caf..9349509ddc 100644 --- a/src/gpu/GrTexture.h +++ b/src/gpu/GrTexture.h @@ -16,8 +16,6 @@ #include "include/private/GrTypesPriv.h" #include "src/gpu/GrSurface.h" -class GrTexturePriv; - class GrTexture : virtual public GrSurface { public: GrTexture* asTexture() override { return this; } @@ -69,9 +67,28 @@ public: this->addIdleProc(sk_make_sp(callback, context), state); } - /** Access methods that are only to be used within Skia code. */ - inline GrTexturePriv texturePriv(); - inline const GrTexturePriv texturePriv() const; + GrTextureType textureType() const { return fTextureType; } + bool hasRestrictedSampling() const { + return GrTextureTypeHasRestrictedSampling(this->textureType()); + } + + void markMipmapsDirty(); + void markMipmapsClean(); + GrMipmapped mipmapped() const { + return GrMipmapped(fMipmapStatus != GrMipmapStatus::kNotAllocated); + } + bool mipmapsAreDirty() const { return fMipmapStatus != GrMipmapStatus::kValid; } + GrMipmapStatus mipmapStatus() const { return fMipmapStatus; } + int maxMipmapLevel() const { return fMaxMipmapLevel; } + + static void ComputeScratchKey(const GrCaps& caps, + const GrBackendFormat& format, + SkISize dimensions, + GrRenderable, + int sampleCnt, + GrMipmapped, + GrProtected, + GrScratchKey* key); protected: GrTexture(GrGpu*, const SkISize&, GrProtected, GrTextureType, GrMipmapStatus); @@ -89,13 +106,10 @@ protected: private: size_t onGpuMemorySize() const override; - void markMipmapsDirty(); - void markMipmapsClean(); GrTextureType fTextureType; GrMipmapStatus fMipmapStatus; int fMaxMipmapLevel; - friend class GrTexturePriv; friend class GrTextureResource; typedef GrSurface INHERITED; diff --git a/src/gpu/GrTexturePriv.h b/src/gpu/GrTexturePriv.h deleted file mode 100644 index 2bbca9c060..0000000000 --- a/src/gpu/GrTexturePriv.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2014 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef GrTexturePriv_DEFINED -#define GrTexturePriv_DEFINED - -#include "src/gpu/GrSamplerState.h" -#include "src/gpu/GrTexture.h" - -/** Class that adds methods to GrTexture that are only intended for use internal to Skia. - This class is purely a privileged window into GrTexture. It should never have additional data - members or virtual methods. - Non-static methods that are not trivial inlines should be spring-boarded (e.g. declared and - implemented privately in GrTexture with a inline public method here). */ -class GrTexturePriv { -public: - void markMipmapsDirty() { - fTexture->markMipmapsDirty(); - } - - void markMipmapsClean() { - fTexture->markMipmapsClean(); - } - - GrMipmapStatus mipmapStatus() const { return fTexture->fMipmapStatus; } - - bool mipmapsAreDirty() const { return GrMipmapStatus::kValid != this->mipmapStatus(); } - - GrMipmapped mipmapped() const { - if (GrMipmapStatus::kNotAllocated != this->mipmapStatus()) { - return GrMipmapped::kYes; - } - return GrMipmapped::kNo; - } - - int maxMipmapLevel() const { - return fTexture->fMaxMipmapLevel; - } - - GrTextureType textureType() const { return fTexture->fTextureType; } - bool hasRestrictedSampling() const { - return GrTextureTypeHasRestrictedSampling(this->textureType()); - } - - static void ComputeScratchKey(const GrCaps& caps, - const GrBackendFormat& format, - SkISize dimensions, - GrRenderable, - int sampleCnt, - GrMipmapped, - GrProtected, - GrScratchKey* key); - -private: - GrTexturePriv(GrTexture* texture) : fTexture(texture) { } - GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { } - GrTexturePriv& operator=(const GrTexturePriv&); // unimpl - - // No taking addresses of this type. - const GrTexturePriv* operator&() const; - GrTexturePriv* operator&(); - - GrTexture* fTexture; - - friend class GrTexture; // to construct/copy this type. -}; - -inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } - -inline const GrTexturePriv GrTexture::texturePriv () const { - return GrTexturePriv(const_cast(this)); -} - -#endif diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp index 70d13bb58b..1b3aa82eef 100644 --- a/src/gpu/GrTextureProxy.cpp +++ b/src/gpu/GrTextureProxy.cpp @@ -13,7 +13,7 @@ #include "src/gpu/GrDeferredProxyUploader.h" #include "src/gpu/GrProxyProvider.h" #include "src/gpu/GrSurfacePriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" // Deferred version - no data GrTextureProxy::GrTextureProxy(const GrBackendFormat& format, @@ -64,8 +64,8 @@ GrTextureProxy::GrTextureProxy(sk_sp surf, UseAllocator useAllocator, GrDDLProvider creatingProvider) : INHERITED(std::move(surf), SkBackingFit::kExact, useAllocator) - , fMipmapped(fTarget->asTexture()->texturePriv().mipmapped()) - , fMipmapStatus(fTarget->asTexture()->texturePriv().mipmapStatus()) + , fMipmapped(fTarget->asTexture()->mipmapped()) + , fMipmapStatus(fTarget->asTexture()->mipmapStatus()) SkDEBUGCODE(, fInitialMipmapStatus(fMipmapStatus)) , fCreatingProvider(creatingProvider) , fProxyProvider(nullptr) @@ -137,7 +137,7 @@ void GrTextureProxyPriv::resetDeferredUploader() { GrMipmapped GrTextureProxy::mipmapped() const { if (this->isInstantiated()) { - return this->peekTexture()->texturePriv().mipmapped(); + return this->peekTexture()->mipmapped(); } return fMipmapped; } @@ -205,9 +205,9 @@ void GrTextureProxy::onValidateSurface(const GrSurface* surface) { SkASSERT(surface->asTexture()); // It is possible to fulfill a non-mipmapped proxy with a mipmapped texture. SkASSERT(GrMipmapped::kNo == this->proxyMipmapped() || - GrMipmapped::kYes == surface->asTexture()->texturePriv().mipmapped()); + GrMipmapped::kYes == surface->asTexture()->mipmapped()); - SkASSERT(surface->asTexture()->texturePriv().textureType() == this->textureType()); + SkASSERT(surface->asTexture()->textureType() == this->textureType()); GrInternalSurfaceFlags proxyFlags = fSurfaceFlags; GrInternalSurfaceFlags surfaceFlags = surface->surfacePriv().flags(); diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp index af78e115b8..9899cae386 100644 --- a/src/gpu/GrTextureRenderTargetProxy.cpp +++ b/src/gpu/GrTextureRenderTargetProxy.cpp @@ -13,7 +13,6 @@ #include "src/gpu/GrSurfacePriv.h" #include "src/gpu/GrSurfaceProxyPriv.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxyPriv.h" #ifdef SK_DEBUG @@ -178,13 +177,13 @@ void GrTextureRenderTargetProxy::onValidateSurface(const GrSurface* surface) { // Anything checked here should also be checking the GrTextureProxy version SkASSERT(surface->asTexture()); SkASSERT(GrMipmapped::kNo == this->proxyMipmapped() || - GrMipmapped::kYes == surface->asTexture()->texturePriv().mipmapped()); + GrMipmapped::kYes == surface->asTexture()->mipmapped()); // Anything checked here should also be checking the GrRenderTargetProxy version SkASSERT(surface->asRenderTarget()); SkASSERT(surface->asRenderTarget()->numSamples() == this->numSamples()); - SkASSERT(surface->asTexture()->texturePriv().textureType() == this->textureType()); + SkASSERT(surface->asTexture()->textureType() == this->textureType()); GrInternalSurfaceFlags proxyFlags = fSurfaceFlags; GrInternalSurfaceFlags surfaceFlags = surface->surfacePriv().flags(); diff --git a/src/gpu/GrTextureResolveRenderTask.cpp b/src/gpu/GrTextureResolveRenderTask.cpp index c374e93e3e..f1b1a35851 100644 --- a/src/gpu/GrTextureResolveRenderTask.cpp +++ b/src/gpu/GrTextureResolveRenderTask.cpp @@ -12,7 +12,7 @@ #include "src/gpu/GrOpFlushState.h" #include "src/gpu/GrRenderTarget.h" #include "src/gpu/GrResourceAllocator.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" void GrTextureResolveRenderTask::addProxy(GrDrawingManager* drawingMgr, sk_sp proxyRef, @@ -81,9 +81,9 @@ bool GrTextureResolveRenderTask::onExecute(GrOpFlushState* flushState) { if (GrSurfaceProxy::ResolveFlags::kMipMaps & resolve.fFlags) { // peekTexture might be null if there was an instantiation error. GrTexture* texture = this->target(i).proxy()->peekTexture(); - if (texture && texture->texturePriv().mipmapsAreDirty()) { + if (texture && texture->mipmapsAreDirty()) { flushState->gpu()->regenerateMipMapLevels(texture); - SkASSERT(!texture->texturePriv().mipmapsAreDirty()); + SkASSERT(!texture->mipmapsAreDirty()); } } } diff --git a/src/gpu/ccpr/GrCCPathProcessor.cpp b/src/gpu/ccpr/GrCCPathProcessor.cpp index 6d122d43be..895f251efc 100644 --- a/src/gpu/ccpr/GrCCPathProcessor.cpp +++ b/src/gpu/ccpr/GrCCPathProcessor.cpp @@ -10,7 +10,6 @@ #include "src/gpu/GrOnFlushResourceProvider.h" #include "src/gpu/GrOpsRenderPass.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/ccpr/GrCCPerFlushResources.h" #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" #include "src/gpu/glsl/GrGLSLGeometryProcessor.h" diff --git a/src/gpu/d3d/GrD3DGpu.cpp b/src/gpu/d3d/GrD3DGpu.cpp index 35480f518d..74d91f51a8 100644 --- a/src/gpu/d3d/GrD3DGpu.cpp +++ b/src/gpu/d3d/GrD3DGpu.cpp @@ -13,7 +13,7 @@ #include "src/core/SkMipmap.h" #include "src/gpu/GrBackendUtils.h" #include "src/gpu/GrDataUtils.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/d3d/GrD3DBuffer.h" #include "src/gpu/d3d/GrD3DCaps.h" #include "src/gpu/d3d/GrD3DOpsRenderPass.h" @@ -621,7 +621,7 @@ bool GrD3DGpu::onWritePixels(GrSurface* surface, int left, int top, int width, i // Need to change the resource state to COPY_DEST in order to upload to it d3dTex->setResourceState(this, D3D12_RESOURCE_STATE_COPY_DEST); - SkASSERT(mipLevelCount <= d3dTex->texturePriv().maxMipmapLevel() + 1); + SkASSERT(mipLevelCount <= d3dTex->maxMipmapLevel() + 1); success = this->uploadToTexture(d3dTex, left, top, width, height, srcColorType, texels, mipLevelCount); @@ -641,7 +641,7 @@ bool GrD3DGpu::uploadToTexture(GrD3DTexture* tex, int left, int top, int width, // We assume that if the texture has mip levels, we either upload to all the levels or just the // first. - SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->texturePriv().maxMipmapLevel() + 1)); + SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->maxMipmapLevel() + 1)); if (width == 0 || height == 0) { return false; @@ -719,7 +719,7 @@ bool GrD3DGpu::uploadToTexture(GrD3DTexture* tex, int left, int top, int width, placedFootprints.get(), left, top); if (mipLevelCount < (int)desc.MipLevels) { - tex->texturePriv().markMipmapsDirty(); + tex->markMipmapsDirty(); } return true; diff --git a/src/gpu/d3d/GrD3DTexture.cpp b/src/gpu/d3d/GrD3DTexture.cpp index dca4050ec2..b7603652d0 100644 --- a/src/gpu/d3d/GrD3DTexture.cpp +++ b/src/gpu/d3d/GrD3DTexture.cpp @@ -7,7 +7,7 @@ #include "src/gpu/d3d/GrD3DTexture.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/d3d/GrD3DGpu.h" #include "src/gpu/d3d/GrD3DUtil.h" diff --git a/src/gpu/d3d/GrD3DTextureRenderTarget.cpp b/src/gpu/d3d/GrD3DTextureRenderTarget.cpp index 416072667b..682c32e8cd 100644 --- a/src/gpu/d3d/GrD3DTextureRenderTarget.cpp +++ b/src/gpu/d3d/GrD3DTextureRenderTarget.cpp @@ -7,7 +7,7 @@ #include "src/gpu/d3d/GrD3DTextureRenderTarget.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/d3d/GrD3DGpu.h" GrD3DTextureRenderTarget::GrD3DTextureRenderTarget( @@ -181,5 +181,5 @@ size_t GrD3DTextureRenderTarget::onGpuMemorySize() const { const GrCaps& caps = *this->getGpu()->caps(); return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), numColorSamples, // TODO: this still correct? - this->texturePriv().mipmapped()); + this->mipmapped()); } diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp index c48d76ac77..dcffb4f418 100644 --- a/src/gpu/dawn/GrDawnGpu.cpp +++ b/src/gpu/dawn/GrDawnGpu.cpp @@ -19,7 +19,7 @@ #include "src/gpu/GrRenderTargetPriv.h" #include "src/gpu/GrSemaphore.h" #include "src/gpu/GrStencilSettings.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/dawn/GrDawnBuffer.h" #include "src/gpu/dawn/GrDawnCaps.h" #include "src/gpu/dawn/GrDawnOpsRenderPass.h" diff --git a/src/gpu/dawn/GrDawnOpsRenderPass.cpp b/src/gpu/dawn/GrDawnOpsRenderPass.cpp index dcaeaf6d50..c62ed44efd 100644 --- a/src/gpu/dawn/GrDawnOpsRenderPass.cpp +++ b/src/gpu/dawn/GrDawnOpsRenderPass.cpp @@ -10,7 +10,7 @@ #include "src/gpu/GrOpFlushState.h" #include "src/gpu/GrPipeline.h" #include "src/gpu/GrRenderTargetPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/dawn/GrDawnBuffer.h" #include "src/gpu/dawn/GrDawnGpu.h" #include "src/gpu/dawn/GrDawnProgramBuilder.h" diff --git a/src/gpu/dawn/GrDawnTextureRenderTarget.cpp b/src/gpu/dawn/GrDawnTextureRenderTarget.cpp index f16a9e5c77..8ad4314f78 100644 --- a/src/gpu/dawn/GrDawnTextureRenderTarget.cpp +++ b/src/gpu/dawn/GrDawnTextureRenderTarget.cpp @@ -8,7 +8,7 @@ #include "src/gpu/dawn/GrDawnTextureRenderTarget.h" #include "include/core/SkTraceMemoryDump.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/dawn/GrDawnGpu.h" GrDawnTextureRenderTarget::GrDawnTextureRenderTarget(GrDawnGpu* gpu, @@ -29,6 +29,6 @@ bool GrDawnTextureRenderTarget::canAttemptStencilAttachment() const { size_t GrDawnTextureRenderTarget::onGpuMemorySize() const { const GrCaps& caps = *this->getGpu()->caps(); return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), - 1, // FIXME: for MSAA - this->texturePriv().mipmapped()); + 1, // FIXME: for MSAA + this->mipmapped()); } diff --git a/src/gpu/effects/GrTextureEffect.cpp b/src/gpu/effects/GrTextureEffect.cpp index 1f97e8ce2d..792312c676 100644 --- a/src/gpu/effects/GrTextureEffect.cpp +++ b/src/gpu/effects/GrTextureEffect.cpp @@ -9,7 +9,6 @@ #include "src/core/SkMatrixPriv.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/effects/GrMatrixEffect.h" #include "src/gpu/glsl/GrGLSLProgramBuilder.h" #include "src/sksl/SkSLCPP.h" @@ -714,7 +713,7 @@ void GrTextureEffect::Impl::onSetData(const GrGLSLProgramDataManager& pdm, const auto& s = te.fSubset; const auto& c = te.fClamp; - auto type = te.texture()->texturePriv().textureType(); + auto type = te.texture()->textureType(); float norm[4] = {w, h, 1.f/w, 1.f/h}; diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index eb1ae82fd7..8a32fb84c0 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -5,8 +5,9 @@ * found in the LICENSE file. */ +#include "src/gpu/gl/GrGLGpu.h" + #include "include/core/SkPixmap.h" -#include "include/core/SkStrokeRec.h" #include "include/core/SkTypes.h" #include "include/gpu/GrBackendSemaphore.h" #include "include/gpu/GrBackendSurface.h" @@ -17,7 +18,6 @@ #include "include/private/SkTo.h" #include "src/core/SkAutoMalloc.h" #include "src/core/SkCompressedDataUtils.h" -#include "src/core/SkConvertPixels.h" #include "src/core/SkMipmap.h" #include "src/core/SkTraceEvent.h" #include "src/gpu/GrBackendUtils.h" @@ -30,9 +30,8 @@ #include "src/gpu/GrRenderTargetPriv.h" #include "src/gpu/GrShaderCaps.h" #include "src/gpu/GrSurfaceProxyPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/gl/GrGLBuffer.h" -#include "src/gpu/gl/GrGLGpu.h" #include "src/gpu/gl/GrGLOpsRenderPass.h" #include "src/gpu/gl/GrGLSemaphore.h" #include "src/gpu/gl/GrGLStencilAttachment.h" @@ -2599,11 +2598,10 @@ void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const GrSwiz } if (samplerState.mipmapped() == GrMipmapped::kYes) { - if (!this->caps()->mipmapSupport() || - texture->texturePriv().mipmapped() == GrMipmapped::kNo) { + if (!this->caps()->mipmapSupport() || texture->mipmapped() == GrMipmapped::kNo) { samplerState.setMipmapMode(GrSamplerState::MipmapMode::kNone); } else { - SkASSERT(!texture->texturePriv().mipmapsAreDirty()); + SkASSERT(!texture->mipmapsAreDirty()); } } @@ -2679,7 +2677,7 @@ void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const GrSwiz } GrGLTextureParameters::NonsamplerState newNonsamplerState; newNonsamplerState.fBaseMipMapLevel = 0; - newNonsamplerState.fMaxMipmapLevel = texture->texturePriv().maxMipmapLevel(); + newNonsamplerState.fMaxMipmapLevel = texture->maxMipmapLevel(); const GrGLTextureParameters::NonsamplerState& oldNonsamplerState = texture->parameters()->nonsamplerState(); @@ -2704,7 +2702,7 @@ void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const GrSwiz } // These are not supported in ES2 contexts if (this->glCaps().mipmapLevelAndLodControlSupport() && - (texture->texturePriv().textureType() != GrTextureType::kExternal || + (texture->textureType() != GrTextureType::kExternal || !this->glCaps().dontSetBaseOrMaxLevelForExternalTextures())) { if (newNonsamplerState.fBaseMipMapLevel != oldNonsamplerState.fBaseMipMapLevel) { this->setTextureUnit(unitIdx); @@ -2825,11 +2823,11 @@ static inline bool can_blit_framebuffer_for_copy_surface(const GrSurface* dst, GrTextureType srcTexType; GrTextureType* srcTexTypePtr = nullptr; if (dstTex) { - dstTexType = dstTex->texturePriv().textureType(); + dstTexType = dstTex->textureType(); dstTexTypePtr = &dstTexType; } if (srcTex) { - srcTexType = srcTex->texturePriv().textureType(); + srcTexType = srcTex->textureType(); srcTexTypePtr = &srcTexType; } @@ -2865,11 +2863,11 @@ static inline bool can_copy_texsubimage(const GrSurface* dst, const GrSurface* s GrTextureType srcTexType; GrTextureType* srcTexTypePtr = nullptr; if (dstTex) { - dstTexType = dstTex->texturePriv().textureType(); + dstTexType = dstTex->textureType(); dstTexTypePtr = &dstTexType; } if (srcTex) { - srcTexType = srcTex->texturePriv().textureType(); + srcTexType = srcTex->textureType(); srcTexTypePtr = &srcTexType; } @@ -3010,8 +3008,7 @@ bool GrGLGpu::createCopyProgram(GrTexture* srcTex) { int progIdx = TextureToCopyProgramIdx(srcTex); const GrShaderCaps* shaderCaps = this->caps()->shaderCaps(); - GrSLType samplerType = - GrSLCombinedSamplerTypeForTextureType(srcTex->texturePriv().textureType()); + GrSLType samplerType = GrSLCombinedSamplerTypeForTextureType(srcTex->textureType()); if (!fCopyProgramArrayBuffer) { static const GrGLfloat vdata[] = { @@ -3321,7 +3318,7 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst, GrSurface* src, const SkIRect& s GrGLfloat sy1 = (GrGLfloat)(srcRect.fTop + h); int sw = src->width(); int sh = src->height(); - if (srcTex->texturePriv().textureType() != GrTextureType::kRectangle) { + if (srcTex->textureType() != GrTextureType::kRectangle) { // src rect edges in normalized texture space (0 to 1) sx0 /= sw; sx1 /= sw; @@ -3429,7 +3426,7 @@ bool GrGLGpu::onRegenerateMipMapLevels(GrTexture* texture) { int width = texture->width(); int height = texture->height(); int levelCount = SkMipmap::ComputeLevelCount(width, height) + 1; - SkASSERT(levelCount == texture->texturePriv().maxMipmapLevel() + 1); + SkASSERT(levelCount == texture->maxMipmapLevel() + 1); // Create (if necessary), then bind temporary FBO: if (0 == fTempDstFBOID) { @@ -4037,7 +4034,7 @@ std::unique_ptr GrGLGpu::prepareTextureForCrossContextUsage(GrTextu } int GrGLGpu::TextureToCopyProgramIdx(GrTexture* texture) { - switch (GrSLCombinedSamplerTypeForTextureType(texture->texturePriv().textureType())) { + switch (GrSLCombinedSamplerTypeForTextureType(texture->textureType())) { case kTexture2DSampler_GrSLType: return 0; case kTexture2DRectSampler_GrSLType: diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index 2b5188c6e3..b61941d323 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -5,16 +5,17 @@ * found in the LICENSE file. */ +#include "src/gpu/gl/GrGLProgram.h" + #include "src/gpu/GrPathProcessor.h" #include "src/gpu/GrPipeline.h" #include "src/gpu/GrProcessor.h" #include "src/gpu/GrProgramInfo.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/GrXferProcessor.h" #include "src/gpu/gl/GrGLBuffer.h" #include "src/gpu/gl/GrGLGpu.h" #include "src/gpu/gl/GrGLPathRendering.h" -#include "src/gpu/gl/GrGLProgram.h" #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" #include "src/gpu/glsl/GrGLSLGeometryProcessor.h" #include "src/gpu/glsl/GrGLSLXferProcessor.h" diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp index c7cfa6c295..12bab86f8e 100644 --- a/src/gpu/gl/GrGLTexture.cpp +++ b/src/gpu/gl/GrGLTexture.cpp @@ -5,12 +5,13 @@ * found in the LICENSE file. */ +#include "src/gpu/gl/GrGLTexture.h" + #include "include/core/SkTraceMemoryDump.h" #include "src/gpu/GrSemaphore.h" #include "src/gpu/GrShaderCaps.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/gl/GrGLGpu.h" -#include "src/gpu/gl/GrGLTexture.h" #define GPUGL static_cast(this->getGpu()) #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) @@ -88,9 +89,7 @@ void GrGLTexture::init(const Desc& desc) { fTextureIDOwnership = desc.fOwnership; } -GrGLenum GrGLTexture::target() const { - return target_from_texture_type(this->texturePriv().textureType()); -} +GrGLenum GrGLTexture::target() const { return target_from_texture_type(this->textureType()); } void GrGLTexture::onRelease() { TRACE_EVENT0("skia.gpu", TRACE_FUNC); @@ -111,16 +110,15 @@ void GrGLTexture::onAbandon() { GrBackendTexture GrGLTexture::getBackendTexture() const { GrGLTextureInfo info; - info.fTarget = target_from_texture_type(this->texturePriv().textureType()); + info.fTarget = target_from_texture_type(this->textureType()); info.fID = fID; info.fFormat = GrGLFormatToEnum(fFormat); - return GrBackendTexture(this->width(), this->height(), this->texturePriv().mipmapped(), info, - fParameters); + return GrBackendTexture(this->width(), this->height(), this->mipmapped(), info, fParameters); } GrBackendFormat GrGLTexture::backendFormat() const { return GrBackendFormat::MakeGL(GrGLFormatToEnum(fFormat), - target_from_texture_type(this->texturePriv().textureType())); + target_from_texture_type(this->textureType())); } sk_sp GrGLTexture::MakeWrapped(GrGLGpu* gpu, diff --git a/src/gpu/gl/GrGLTextureRenderTarget.cpp b/src/gpu/gl/GrGLTextureRenderTarget.cpp index 2effb7cce4..ba032f4298 100644 --- a/src/gpu/gl/GrGLTextureRenderTarget.cpp +++ b/src/gpu/gl/GrGLTextureRenderTarget.cpp @@ -5,12 +5,13 @@ * found in the LICENSE file. */ +#include "src/gpu/gl/GrGLTextureRenderTarget.h" + #include "include/core/SkTraceMemoryDump.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrContextPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/gl/GrGLGpu.h" -#include "src/gpu/gl/GrGLTextureRenderTarget.h" GrGLTextureRenderTarget::GrGLTextureRenderTarget(GrGLGpu* gpu, SkBudgeted budgeted, @@ -73,5 +74,5 @@ sk_sp GrGLTextureRenderTarget::MakeWrapped( size_t GrGLTextureRenderTarget::onGpuMemorySize() const { const GrCaps& caps = *this->getGpu()->caps(); return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), - this->numSamplesOwnedPerPixel(), this->texturePriv().mipmapped()); + this->numSamplesOwnedPerPixel(), this->mipmapped()); } diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp index 396a9ac806..1e2b31c231 100644 --- a/src/gpu/gl/GrGLUniformHandler.cpp +++ b/src/gpu/gl/GrGLUniformHandler.cpp @@ -7,7 +7,7 @@ #include "src/gpu/gl/GrGLUniformHandler.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/gl/GrGLCaps.h" #include "src/gpu/gl/GrGLGpu.h" #include "src/gpu/gl/builders/GrGLProgramBuilder.h" diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp index c4ec408533..8f5be02b44 100644 --- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp +++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp @@ -11,7 +11,7 @@ #include "src/gpu/GrPipeline.h" #include "src/gpu/GrRenderTarget.h" #include "src/gpu/GrShaderCaps.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" #include "src/gpu/glsl/GrGLSLGeometryProcessor.h" #include "src/gpu/glsl/GrGLSLVarying.h" diff --git a/src/gpu/mock/GrMockOpsRenderPass.h b/src/gpu/mock/GrMockOpsRenderPass.h index 5be93f405d..93ced13b62 100644 --- a/src/gpu/mock/GrMockOpsRenderPass.h +++ b/src/gpu/mock/GrMockOpsRenderPass.h @@ -10,7 +10,7 @@ #include "src/gpu/GrOpsRenderPass.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/mock/GrMockGpu.h" class GrMockOpsRenderPass : public GrOpsRenderPass { @@ -55,7 +55,7 @@ private: } void markRenderTargetDirty() { if (auto* tex = fRenderTarget->asTexture()) { - tex->texturePriv().markMipmapsDirty(); + tex->markMipmapsDirty(); } } diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h index 6de118bc47..399044c0ad 100644 --- a/src/gpu/mock/GrMockTexture.h +++ b/src/gpu/mock/GrMockTexture.h @@ -12,7 +12,6 @@ #include "src/gpu/GrRenderTargetPriv.h" #include "src/gpu/GrStencilAttachment.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/mock/GrMockGpu.h" class GrMockTexture : public GrTexture { @@ -44,8 +43,7 @@ public: ~GrMockTexture() override {} GrBackendTexture getBackendTexture() const override { - return GrBackendTexture(this->width(), this->height(), this->texturePriv().mipmapped(), - fInfo); + return GrBackendTexture(this->width(), this->height(), this->mipmapped(), fInfo); } GrBackendFormat backendFormat() const override { @@ -210,7 +208,7 @@ private: } const GrCaps& caps = *this->getGpu()->caps(); return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), - numColorSamples, this->texturePriv().mipmapped()); + numColorSamples, this->mipmapped()); } // This avoids an inherits via dominance warning on MSVC. diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm index 573caba799..88b1faddd1 100644 --- a/src/gpu/mtl/GrMtlGpu.mm +++ b/src/gpu/mtl/GrMtlGpu.mm @@ -14,7 +14,7 @@ #include "src/gpu/GrBackendUtils.h" #include "src/gpu/GrDataUtils.h" #include "src/gpu/GrRenderTargetPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/mtl/GrMtlBuffer.h" #include "src/gpu/mtl/GrMtlCommandBuffer.h" #include "src/gpu/mtl/GrMtlOpsRenderPass.h" @@ -237,7 +237,7 @@ bool GrMtlGpu::uploadToTexture(GrMtlTexture* tex, int left, int top, int width, // We assume that if the texture has mip levels, we either upload to all the levels or just the // first. - SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->texturePriv().maxMipmapLevel() + 1)); + SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->maxMipmapLevel() + 1)); if (!check_max_blit_width(width)) { return false; @@ -316,7 +316,7 @@ bool GrMtlGpu::uploadToTexture(GrMtlTexture* tex, int left, int top, int width, #endif if (mipLevelCount < (int) tex->mtlTexture().mipmapLevelCount) { - tex->texturePriv().markMipmapsDirty(); + tex->markMipmapsDirty(); } return true; @@ -403,7 +403,7 @@ bool GrMtlGpu::clearTexture(GrMtlTexture* tex, size_t bpp, uint32_t levelMask) { } if (mipLevelCount < (int) tex->mtlTexture().mipmapLevelCount) { - tex->texturePriv().markMipmapsDirty(); + tex->markMipmapsDirty(); } return true; diff --git a/src/gpu/mtl/GrMtlPipelineState.mm b/src/gpu/mtl/GrMtlPipelineState.mm index 692a7a093a..6b746fdcc1 100644 --- a/src/gpu/mtl/GrMtlPipelineState.mm +++ b/src/gpu/mtl/GrMtlPipelineState.mm @@ -10,7 +10,7 @@ #include "src/gpu/GrPipeline.h" #include "src/gpu/GrRenderTarget.h" #include "src/gpu/GrRenderTargetPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" #include "src/gpu/glsl/GrGLSLGeometryProcessor.h" #include "src/gpu/glsl/GrGLSLXferProcessor.h" diff --git a/src/gpu/mtl/GrMtlTexture.mm b/src/gpu/mtl/GrMtlTexture.mm index be1d43c06c..f58fed45b5 100644 --- a/src/gpu/mtl/GrMtlTexture.mm +++ b/src/gpu/mtl/GrMtlTexture.mm @@ -7,7 +7,7 @@ #include "src/gpu/mtl/GrMtlTexture.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/mtl/GrMtlGpu.h" #include "src/gpu/mtl/GrMtlUtil.h" diff --git a/src/gpu/mtl/GrMtlUniformHandler.mm b/src/gpu/mtl/GrMtlUniformHandler.mm index 92fb5deb44..80f7b3bd9e 100644 --- a/src/gpu/mtl/GrMtlUniformHandler.mm +++ b/src/gpu/mtl/GrMtlUniformHandler.mm @@ -6,7 +6,6 @@ */ #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/glsl/GrGLSLProgramBuilder.h" #include "src/gpu/mtl/GrMtlUniformHandler.h" diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp index b672d1a4b6..ddc32f1050 100644 --- a/src/gpu/ops/GrTextureOp.cpp +++ b/src/gpu/ops/GrTextureOp.cpp @@ -27,7 +27,6 @@ #include "src/gpu/GrResourceProviderPriv.h" #include "src/gpu/GrShaderCaps.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxy.h" #include "src/gpu/SkGr.h" #include "src/gpu/effects/GrXfermodeFragmentProcessor.h" diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index df2278e397..9c3d83b17a 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -24,7 +24,7 @@ #include "src/gpu/GrPipeline.h" #include "src/gpu/GrRenderTargetContext.h" #include "src/gpu/GrRenderTargetPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/SkGpuDevice.h" #include "src/gpu/SkGr.h" #include "src/gpu/vk/GrVkAMDMemoryAllocator.h" @@ -466,7 +466,7 @@ bool GrVkGpu::onWritePixels(GrSurface* surface, int left, int top, int width, in success = this->uploadTexDataLinear(vkTex, left, top, width, height, srcColorType, texels[0].fPixels, texels[0].fRowBytes); } else { - SkASSERT(mipLevelCount <= vkTex->texturePriv().maxMipmapLevel() + 1); + SkASSERT(mipLevelCount <= vkTex->maxMipmapLevel() + 1); success = this->uploadTexDataOptimal(vkTex, left, top, width, height, srcColorType, texels, mipLevelCount); } @@ -544,7 +544,7 @@ bool GrVkGpu::onTransferPixelsTo(GrTexture* texture, int left, int top, int widt 1, ®ion); - vkTex->texturePriv().markMipmapsDirty(); + vkTex->markMipmapsDirty(); return true; } @@ -784,7 +784,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, int left, int top, int widt // We assume that if the texture has mip levels, we either upload to all the levels or just the // first. - SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->texturePriv().maxMipmapLevel() + 1)); + SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->maxMipmapLevel() + 1)); if (width == 0 || height == 0) { return false; @@ -952,7 +952,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, int left, int top, int widt SkIPoint::Make(left, top))); } if (1 == mipLevelCount) { - tex->texturePriv().markMipmapsDirty(); + tex->markMipmapsDirty(); } return true; @@ -1422,7 +1422,7 @@ bool GrVkGpu::onRegenerateMipMapLevels(GrTexture* tex) { SkDebugf("Trying to create mipmap for linear tiled texture"); return false; } - SkASSERT(tex->texturePriv().textureType() == GrTextureType::k2D); + SkASSERT(tex->textureType() == GrTextureType::k2D); // determine if we can blit to and from this format const GrVkCaps& caps = this->vkCaps(); diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp index 953b0d397a..b7ea34ba5f 100644 --- a/src/gpu/vk/GrVkPipelineState.cpp +++ b/src/gpu/vk/GrVkPipelineState.cpp @@ -10,7 +10,7 @@ #include "src/core/SkMipmap.h" #include "src/gpu/GrPipeline.h" #include "src/gpu/GrRenderTarget.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" #include "src/gpu/glsl/GrGLSLGeometryProcessor.h" #include "src/gpu/glsl/GrGLSLXferProcessor.h" diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp index 101bb150ca..287883c5f7 100644 --- a/src/gpu/vk/GrVkTexture.cpp +++ b/src/gpu/vk/GrVkTexture.cpp @@ -7,7 +7,7 @@ #include "src/gpu/vk/GrVkTexture.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/vk/GrVkDescriptorSet.h" #include "src/gpu/vk/GrVkGpu.h" #include "src/gpu/vk/GrVkImageView.h" diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp index 99cc2d9615..95260ebc06 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.cpp +++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp @@ -7,7 +7,7 @@ #include "src/gpu/vk/GrVkTextureRenderTarget.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/vk/GrVkGpu.h" #include "src/gpu/vk/GrVkImageView.h" #include "src/gpu/vk/GrVkUtil.h" @@ -255,5 +255,5 @@ size_t GrVkTextureRenderTarget::onGpuMemorySize() const { const GrCaps& caps = *this->getGpu()->caps(); return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), numColorSamples, // TODO: this still correct? - this->texturePriv().mipmapped()); + this->mipmapped()); } diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp index d11377d96d..987c5666d6 100644 --- a/src/gpu/vk/GrVkUniformHandler.cpp +++ b/src/gpu/vk/GrVkUniformHandler.cpp @@ -7,7 +7,7 @@ #include "src/gpu/vk/GrVkUniformHandler.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/glsl/GrGLSLProgramBuilder.h" #include "src/gpu/vk/GrVkGpu.h" #include "src/gpu/vk/GrVkPipelineStateBuilder.h" diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index f73c13892b..c26debce4c 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -38,7 +38,6 @@ #include "src/gpu/GrSurfacePriv.h" #include "src/gpu/GrTexture.h" #include "src/gpu/GrTextureAdjuster.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxy.h" #include "src/gpu/GrTextureProxyPriv.h" #include "src/gpu/SkGr.h" diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp index 4c30b6c77d..22c152b1a7 100644 --- a/tests/EGLImageTest.cpp +++ b/tests/EGLImageTest.cpp @@ -12,7 +12,6 @@ #include "src/gpu/GrShaderCaps.h" #include "src/gpu/GrSurfacePriv.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "src/gpu/GrTextureProxyPriv.h" #include "src/gpu/gl/GrGLGpu.h" #include "src/gpu/gl/GrGLUtil.h" @@ -182,13 +181,12 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { GrTextureProxy* proxy = surfaceContext->asTextureProxy(); REPORTER_ASSERT(reporter, proxy->mipmapped() == GrMipmapped::kNo); - REPORTER_ASSERT(reporter, proxy->peekTexture()->texturePriv().mipmapped() == GrMipmapped::kNo); + REPORTER_ASSERT(reporter, proxy->peekTexture()->mipmapped() == GrMipmapped::kNo); REPORTER_ASSERT(reporter, proxy->textureType() == GrTextureType::kExternal); - REPORTER_ASSERT(reporter, - proxy->peekTexture()->texturePriv().textureType() == GrTextureType::kExternal); + REPORTER_ASSERT(reporter, proxy->peekTexture()->textureType() == GrTextureType::kExternal); REPORTER_ASSERT(reporter, proxy->hasRestrictedSampling()); - REPORTER_ASSERT(reporter, proxy->peekTexture()->texturePriv().hasRestrictedSampling()); + REPORTER_ASSERT(reporter, proxy->peekTexture()->hasRestrictedSampling()); // Should not be able to wrap as a RT { diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp index a327f686fe..76be91fbc4 100644 --- a/tests/GrMipMappedTest.cpp +++ b/tests/GrMipMappedTest.cpp @@ -21,7 +21,7 @@ #include "src/gpu/GrRenderTargetContext.h" #include "src/gpu/GrSemaphore.h" #include "src/gpu/GrSurfaceProxyPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/GrTextureProxy.h" #include "src/gpu/SkGpuDevice.h" #include "src/image/SkImage_Base.h" @@ -92,14 +92,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) { } if (GrMipmapped::kYes == mipMapped) { - REPORTER_ASSERT(reporter, GrMipmapped::kYes == texture->texturePriv().mipmapped()); + REPORTER_ASSERT(reporter, GrMipmapped::kYes == texture->mipmapped()); if (GrRenderable::kYes == renderable) { - REPORTER_ASSERT(reporter, texture->texturePriv().mipmapsAreDirty()); + REPORTER_ASSERT(reporter, texture->mipmapsAreDirty()); } else { - REPORTER_ASSERT(reporter, !texture->texturePriv().mipmapsAreDirty()); + REPORTER_ASSERT(reporter, !texture->mipmapsAreDirty()); } } else { - REPORTER_ASSERT(reporter, GrMipmapped::kNo == texture->texturePriv().mipmapped()); + REPORTER_ASSERT(reporter, GrMipmapped::kNo == texture->mipmapped()); } context->deleteBackendTexture(backendTex); } @@ -288,7 +288,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn texProxy->instantiate(resourceProvider); GrTexture* texture = texProxy->peekTexture(); - REPORTER_ASSERT(reporter, mipMapped == texture->texturePriv().mipmapped()); + REPORTER_ASSERT(reporter, mipMapped == texture->mipmapped()); sk_sp image = surface->makeImageSnapshot(); REPORTER_ASSERT(reporter, image); @@ -300,7 +300,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn texProxy->instantiate(resourceProvider); texture = texProxy->peekTexture(); - REPORTER_ASSERT(reporter, mipMapped == texture->texturePriv().mipmapped()); + REPORTER_ASSERT(reporter, mipMapped == texture->mipmapped()); // Must flush the context to make sure all the cmds (copies, etc.) from above are sent // to the gpu before we delete the backendHandle. diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index 0dedcc6331..216ce0eb21 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -20,7 +20,6 @@ #include "src/gpu/GrRenderTargetContext.h" #include "src/gpu/GrResourceProvider.h" #include "src/gpu/GrTexture.h" -#include "src/gpu/GrTexturePriv.h" #include "tests/Test.h" #include "tests/TestUtils.h" @@ -422,7 +421,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadOnlyTexture, reporter, context_info) { proxy = proxyProvider->wrapBackendTexture(backendTex, kBorrow_GrWrapOwnership, GrWrapCacheable::kNo, ioType); context->flushAndSubmit(); - proxy->peekTexture()->texturePriv().markMipmapsDirty(); // avoids assert in GrGpu. + proxy->peekTexture()->markMipmapsDirty(); // avoids assert in GrGpu. auto regenResult = context->priv().getGpu()->regenerateMipMapLevels(proxy->peekTexture()); REPORTER_ASSERT(reporter, regenResult == (ioType == kRW_GrIOType)); diff --git a/tests/GrTextureMipMapInvalidationTest.cpp b/tests/GrTextureMipMapInvalidationTest.cpp index 3c56d95b80..3aea5bffab 100644 --- a/tests/GrTextureMipMapInvalidationTest.cpp +++ b/tests/GrTextureMipMapInvalidationTest.cpp @@ -9,7 +9,7 @@ #include "include/core/SkSurface.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrContextPriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/image/SkImage_Base.h" #include "src/image/SkImage_GpuBase.h" #include "tests/Test.h" @@ -24,12 +24,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrTextureMipMapInvalidationTest, reporter, ct auto isMipped = [] (SkSurface* surf) { SkImage_GpuBase* image = static_cast(as_IB(surf->makeImageSnapshot())); const GrTexture* texture = image->getTexture(); - return GrMipmapped::kYes == texture->texturePriv().mipmapped(); + return GrMipmapped::kYes == texture->mipmapped(); }; auto mipsAreDirty = [] (SkSurface* surf) { SkImage_GpuBase* image = static_cast(as_IB(surf->makeImageSnapshot())); - return image->getTexture()->texturePriv().mipmapsAreDirty(); + return image->getTexture()->mipmapsAreDirty(); }; auto info = SkImageInfo::MakeN32Premul(256, 256); diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index 6510573e54..d805c2b4f8 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -14,7 +14,7 @@ #include "src/gpu/GrRenderTargetContext.h" #include "src/gpu/GrSurfaceContextPriv.h" #include "src/gpu/GrSurfacePriv.h" -#include "src/gpu/GrTexturePriv.h" +#include "src/gpu/GrTexture.h" #include "src/gpu/SkGr.h" #ifdef SK_GL #include "src/gpu/gl/GrGLGpu.h" @@ -165,13 +165,12 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(RectangleTexture, reporter, ctxInfo) { } SkASSERT(rectProxy->mipmapped() == GrMipmapped::kNo); - SkASSERT(rectProxy->peekTexture()->texturePriv().mipmapped() == GrMipmapped::kNo); + SkASSERT(rectProxy->peekTexture()->mipmapped() == GrMipmapped::kNo); SkASSERT(rectProxy->textureType() == GrTextureType::kRectangle); - SkASSERT(rectProxy->peekTexture()->texturePriv().textureType() == - GrTextureType::kRectangle); + SkASSERT(rectProxy->peekTexture()->textureType() == GrTextureType::kRectangle); SkASSERT(rectProxy->hasRestrictedSampling()); - SkASSERT(rectProxy->peekTexture()->texturePriv().hasRestrictedSampling()); + SkASSERT(rectProxy->peekTexture()->hasRestrictedSampling()); GrSwizzle swizzle = direct->priv().caps()->getReadSwizzle(rectangleTex.getBackendFormat(), GrColorType::kRGBA_8888);