Retract GrTexture*.h & GrRenderTarget*.h from other headers

This does push some additional work (& includes) into the .cpp files.

Change-Id: I27c847e371802270d13594dcc22aae44039990bb
Reviewed-on: https://skia-review.googlesource.com/19660
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Robert Phillips 2017-06-13 12:44:56 -04:00 committed by Skia Commit-Bot
parent 1791a064f1
commit 646e4293f0
75 changed files with 177 additions and 128 deletions

View File

@ -19,7 +19,6 @@
#include "GrContext.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLUtil.h"
#include "GrRenderTarget.h"
class SkGLWidget : public QGLWidget {
Q_OBJECT

View File

@ -18,7 +18,6 @@
#include "gl/GrGLUtil.h"
#include "gl/GrGLDefines.h"
#include "gl/GrGLInterface.h"
#include "GrRenderTarget.h"
#include "GrContext.h"
#include "SkApplication.h"
#include "SkCommandLineFlags.h"

View File

@ -16,7 +16,6 @@
# include "GrRenderTargetContextPriv.h"
# include "GrFixedClip.h"
# include "GrReducedClip.h"
# include "GrRenderTargetPriv.h"
# include "GrResourceProvider.h"
# include "effects/GrTextureDomain.h"
#endif

View File

@ -43,7 +43,6 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrRenderTarget.h"
#include "SkGr.h"
#endif

View File

@ -18,6 +18,7 @@
#include "GrContext.h"
#include "GrCoordTransform.h"
#include "GrRenderTargetContext.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "SkGr.h"
#include "effects/GrTextureDomain.h"

View File

@ -21,6 +21,7 @@
#include "GrFragmentProcessor.h"
#include "GrPaint.h"
#include "GrRenderTargetContext.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "SkGr.h"

View File

@ -17,6 +17,7 @@
////////////////////////////////////////////////////////////////////////////////
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrTexture.h"
#include "effects/GrProxyMove.h"
#include "effects/GrSingleTextureEffect.h"
#include "glsl/GrGLSLColorSpaceXformHelper.h"

View File

@ -19,6 +19,7 @@
#include "GrContext.h"
#include "GrFixedClip.h"
#include "GrRenderTargetContext.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "SkGr.h"

View File

@ -9,9 +9,11 @@
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
#include "GrResourceCache.h"
#include "GrResourceProvider.h"
#include "GrSemaphore.h"
#include "GrTexture.h"
#include "SkGr.h"
#include "SkMessageBus.h"

View File

@ -10,6 +10,7 @@
#include "GrContextOptions.h"
#include "GrContextPriv.h"
#include "GrDrawingManager.h"
#include "GrGpu.h"
#include "GrRenderTargetContext.h"
#include "GrRenderTargetProxy.h"
#include "GrResourceCache.h"
@ -19,6 +20,7 @@
#include "GrSurfaceContext.h"
#include "GrSurfacePriv.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "GrTextureContext.h"
#include "SkConvertPixels.h"
#include "SkGr.h"

View File

@ -10,10 +10,10 @@
#include "SkMatrix.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
class GrResourceProvider;
class GrTexture;
/**
* A class representing a linear transformation of local coordinates. GrFragnentProcessors

View File

@ -11,6 +11,7 @@
#include "GrOpFlushState.h"
#include "GrRectanizer.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
#include "GrTracing.h"
std::unique_ptr<GrDrawOpAtlas> GrDrawOpAtlas::Make(GrContext* ctx, GrPixelConfig config,

View File

@ -8,6 +8,7 @@
#include "GrDrawingManager.h"
#include "GrContext.h"
#include "GrGpu.h"
#include "GrRenderTargetContext.h"
#include "GrPathRenderingRenderTargetContext.h"
#include "GrRenderTargetProxy.h"

View File

@ -163,6 +163,20 @@ sk_sp<GrTexture> GrGpu::createTexture(const GrSurfaceDesc& origDesc, SkBudgeted
return tex;
}
sk_sp<GrTexture> GrGpu::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) {
return this->createTexture(desc, budgeted, SkTArray<GrMipLevel>());
}
sk_sp<GrTexture> GrGpu::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted,
const void* level0Data,
size_t rowBytes) {
SkASSERT(level0Data);
GrMipLevel level = { level0Data, rowBytes };
SkSTArray<1, GrMipLevel> array;
array.push_back() = level;
return this->createTexture(desc, budgeted, array);
}
sk_sp<GrTexture> GrGpu::wrapBackendTexture(const GrBackendTexture& backendTex,
GrSurfaceOrigin origin,
GrBackendTextureFlags flags,

View File

@ -111,20 +111,12 @@ public:
/**
* Simplified createTexture() interface for when there is no initial texel data to upload.
*/
sk_sp<GrTexture> createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) {
return this->createTexture(desc, budgeted, SkTArray<GrMipLevel>());
}
sk_sp<GrTexture> createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted);
/** Simplified createTexture() interface for when there is only a base level */
sk_sp<GrTexture> createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted,
const void* level0Data,
size_t rowBytes) {
SkASSERT(level0Data);
GrMipLevel level = { level0Data, rowBytes };
SkSTArray<1, GrMipLevel> array;
array.push_back() = level;
return this->createTexture(desc, budgeted, array);
}
size_t rowBytes);
/**
* Implements GrResourceProvider::wrapBackendTexture

View File

@ -8,7 +8,9 @@
#include "GrOpFlushState.h"
#include "GrDrawOpAtlas.h"
#include "GrGpu.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
GrOpFlushState::GrOpFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider)
: fGpu(gpu)
@ -20,6 +22,10 @@ GrOpFlushState::GrOpFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider)
, fLastFlushedToken(0)
, fOpArgs(nullptr) {}
const GrCaps& GrOpFlushState::caps() const {
return *fGpu->caps();
}
void* GrOpFlushState::makeVertexSpace(size_t vertexSize, int vertexCount,
const GrBuffer** buffer, int* startVertex) {
return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex);

View File

@ -9,10 +9,10 @@
#define GrOpFlushState_DEFINED
#include "GrBufferAllocPool.h"
#include "GrGpu.h"
#include "SkArenaAlloc.h"
#include "ops/GrMeshDrawOp.h"
class GrGpu;
class GrGpuCommandBuffer;
class GrResourceProvider;
@ -29,7 +29,7 @@ public:
fAsapUploads.emplace_back(std::move(upload));
}
const GrCaps& caps() const { return *fGpu->caps(); }
const GrCaps& caps() const;
GrResourceProvider* resourceProvider() const { return fResourceProvider; }
/** Has the token been flushed to the backend 3D API. */

View File

@ -13,6 +13,7 @@
#include "GrPaint.h"
#include "GrResourceProvider.h"
#include "GrShape.h"
#include "GrUserStencilSettings.h"
#include "SkDrawProcs.h"
#include "SkTArray.h"

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "GrGpu.h"
#include "GrPathRendering.h"
#include "SkDescriptor.h"
#include "SkGlyph.h"
@ -97,10 +98,48 @@ sk_sp<GrPathRange> GrPathRendering::createGlyphs(const SkTypeface* typeface,
genericDesc->init();
genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec);
genericDesc->computeChecksum();
// No effects, so we make a dummy struct
SkScalerContextEffects noEffects;
sk_sp<GlyphGenerator> generator(new GlyphGenerator(*typeface, noEffects, *genericDesc));
return this->createPathRange(generator.get(), style);
}
void GrPathRendering::stencilPath(const StencilPathArgs& args, const GrPath* path) {
fGpu->handleDirtyContext();
this->onStencilPath(args, path);
}
void GrPathRendering::drawPath(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
// Cover pass settings in pipeline.
const GrStencilSettings& stencilPassSettings,
const GrPath* path) {
fGpu->handleDirtyContext();
if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
this->onDrawPath(pipeline, primProc, stencilPassSettings, path);
}
void GrPathRendering::drawPaths(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
// Cover pass settings in pipeline.
const GrStencilSettings& stencilPassSettings,
const GrPathRange* pathRange,
const void* indices,
PathIndexType indexType,
const float transformValues[],
PathTransformType transformType,
int count) {
fGpu->handleDirtyContext();
if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
#ifdef SK_DEBUG
pathRange->assertPathsLoaded(indices, indexType, count);
#endif
this->onDrawPaths(pipeline, primProc, stencilPassSettings, pathRange, indices, indexType,
transformValues, transformType, count);
}

View File

@ -9,12 +9,12 @@
#define GrPathRendering_DEFINED
#include "SkPath.h"
#include "GrGpu.h"
#include "GrPathRange.h"
#include "GrPipeline.h"
class SkDescriptor;
class SkTypeface;
class GrGpu;
class GrPath;
class GrStencilSettings;
class GrStyle;
@ -149,21 +149,12 @@ public:
const GrStencilSettings* fStencil;
};
void stencilPath(const StencilPathArgs& args, const GrPath* path) {
fGpu->handleDirtyContext();
this->onStencilPath(args, path);
}
void stencilPath(const StencilPathArgs& args, const GrPath* path);
void drawPath(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
const GrStencilSettings& stencilPassSettings, // Cover pass settings in pipeline.
const GrPath* path) {
fGpu->handleDirtyContext();
if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
this->onDrawPath(pipeline, primProc, stencilPassSettings, path);
}
const GrPath* path);
void drawPaths(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
@ -173,22 +164,11 @@ public:
PathIndexType indexType,
const float transformValues[],
PathTransformType transformType,
int count) {
fGpu->handleDirtyContext();
if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
#ifdef SK_DEBUG
pathRange->assertPathsLoaded(indices, indexType, count);
#endif
this->onDrawPaths(pipeline, primProc, stencilPassSettings, pathRange, indices, indexType,
transformValues, transformType, count);
}
int count);
protected:
GrPathRendering(GrGpu* gpu)
: fGpu(gpu) {
}
GrPathRendering(GrGpu* gpu) : fGpu(gpu) { }
virtual void onStencilPath(const StencilPathArgs&, const GrPath*) = 0;
virtual void onDrawPath(const GrPipeline&,
const GrPrimitiveProcessor&,

View File

@ -11,7 +11,6 @@
#include "GrGpuResourceRef.h"
#include "GrPipeline.h"
#include "GrProcessorSet.h"
#include "GrRenderTarget.h"
#include "GrUserStencilSettings.h"
#include "GrXferProcessor.h"

View File

@ -18,7 +18,6 @@
#include "GrPipelineBuilder.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetContextPriv.h"
#include "GrRenderTargetPriv.h"
#include "GrResourceProvider.h"
#include "GrStencilAttachment.h"
#include "SkDrawShadowRec.h"

View File

@ -11,7 +11,6 @@
#include "GrGpu.h"
#include "GrGpuCommandBuffer.h"
#include "GrRect.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetContext.h"
#include "GrResourceProvider.h"
#include "instanced/InstancedRendering.h"

View File

@ -12,6 +12,7 @@
#include "GrOpList.h"
#include "GrPathRendering.h"
#include "GrPrimitiveProcessor.h"
#include "ops/GrOp.h"
#include "SkArenaAlloc.h"
#include "SkClipStack.h"
#include "SkMatrix.h"
@ -24,10 +25,13 @@
class GrAuditTrail;
class GrClearOp;
class GrCaps;
class GrOp;
class GrPipelineBuilder;
class GrRenderTargetProxy;
namespace gr_instanced {
class InstancedRendering;
}
class GrRenderTargetOpList final : public GrOpList {
private:
using DstProxy = GrXferProcessor::DstProxy;

View File

@ -307,6 +307,11 @@ GrTexture* GrResourceProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& k
return NULL;
}
void GrResourceProvider::assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) {
SkASSERT(key.isValid());
this->assignUniqueKeyToResource(key, texture);
}
// MDB TODO (caching): this side-steps the issue of texture proxies with unique IDs
void GrResourceProvider::assignUniqueKeyToProxy(const GrUniqueKey& key, GrTextureProxy* proxy) {
ASSERT_SINGLE_OWNER

View File

@ -11,12 +11,18 @@
#include "GrBuffer.h"
#include "GrGpu.h"
#include "GrPathRange.h"
#include "SkImageInfo.h"
class GrBackendRenderTarget;
class GrPath;
class GrRenderTarget;
class GrSemaphore;
class GrSingleOwner;
class GrStencilAttachment;
class GrSurfaceProxy;
class GrTexture;
class GrTextureProxy;
class GrStyle;
class SkDescriptor;
class SkPath;
@ -243,10 +249,7 @@ public:
private:
GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key);
void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) {
SkASSERT(key.isValid());
this->assignUniqueKeyToResource(key, texture);
}
void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture);
sk_sp<GrTexture> refScratchTexture(const GrSurfaceDesc&, uint32_t scratchTextureFlags);

View File

@ -10,7 +10,6 @@
#include "GrGpu.h"
#include "GrResourceKey.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetPriv.h"
#include "GrTexture.h"
#include "GrTexturePriv.h"
#include "GrTypes.h"

View File

@ -8,11 +8,12 @@
#ifndef GrTracing_DEFINED
#define GrTracing_DEFINED
#include "GrGpu.h"
#include "GrTraceMarker.h"
#include "SkTLazy.h"
#include "SkTraceEvent.h"
class GrContext;
/**
* Marker generation class used for adding and removing markers around code blocks
*/

View File

@ -8,6 +8,7 @@
#include "GrBicubicEffect.h"
#include "GrProxyMove.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "glsl/GrGLSLColorSpaceXformHelper.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"

View File

@ -8,6 +8,7 @@
#include "GrGaussianConvolutionFragmentProcessor.h"
#include "GrProxyMove.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "../private/GrGLSL.h"
#include "glsl/GrGLSLFragmentProcessor.h"

View File

@ -6,6 +6,7 @@
*/
#include "GrMatrixConvolutionEffect.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"

View File

@ -13,7 +13,6 @@
#include "GrCoordTransform.h"
#include "SkMatrix.h"
class GrTexture;
class GrTextureProxy;
/**

View File

@ -11,6 +11,7 @@
#include "GrShaderCaps.h"
#include "GrSimpleTextureEffect.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "SkFloatingPoint.h"
#include "glsl/GrGLSLColorSpaceXformHelper.h"
#include "glsl/GrGLSLFragmentProcessor.h"

View File

@ -4309,3 +4309,19 @@ sk_sp<GrSemaphore> GrGLGpu::prepareTextureForCrossContextUsage(GrTexture* textur
return semaphore;
}
int GrGLGpu::TextureToCopyProgramIdx(GrTexture* texture) {
switch (texture->texturePriv().samplerType()) {
case kTexture2DSampler_GrSLType:
return 0;
case kITexture2DSampler_GrSLType:
return 1;
case kTexture2DRectSampler_GrSLType:
return 2;
case kTextureExternalSampler_GrSLType:
return 3;
default:
SkFAIL("Unexpected samper type");
return 0;
}
}

View File

@ -18,7 +18,6 @@
#include "GrGLVertexArray.h"
#include "GrGpu.h"
#include "GrMesh.h"
#include "GrTexturePriv.h"
#include "GrWindowRectsState.h"
#include "GrXferProcessor.h"
#include "SkLRUCache.h"
@ -618,21 +617,7 @@ private:
GrGLuint fStencilClipClearProgram;
sk_sp<GrGLBuffer> fStencilClipClearArrayBuffer;
static int TextureToCopyProgramIdx(GrTexture* texture) {
switch (texture->texturePriv().samplerType()) {
case kTexture2DSampler_GrSLType:
return 0;
case kITexture2DSampler_GrSLType:
return 1;
case kTexture2DRectSampler_GrSLType:
return 2;
case kTextureExternalSampler_GrSLType:
return 3;
default:
SkFAIL("Unexpected samper type");
return 0;
}
}
static int TextureToCopyProgramIdx(GrTexture* texture);
static int TextureSizeToMipmapProgramIdx(int width, int height) {
const bool wide = (width > 1) && SkToBool(width & 0x1);

View File

@ -9,6 +9,7 @@
#define GrGLPathRendering_DEFINED
#include "SkRefCnt.h"
#include "GrGpu.h"
#include "GrPathRendering.h"
#include "GrStencilSettings.h"
#include "gl/GrGLTypes.h"

View File

@ -8,6 +8,7 @@
#include "GrGLTextureRenderTarget.h"
#include "GrContext.h"
#include "GrTexturePriv.h"
#include "SkTraceMemoryDump.h"
// GrGLTextureRenderTarget must dump both of its superclasses.
@ -52,3 +53,9 @@ sk_sp<GrGLTextureRenderTarget> GrGLTextureRenderTarget::MakeWrapped(
return sk_sp<GrGLTextureRenderTarget>(
new GrGLTextureRenderTarget(gpu, desc, texIDDesc, rtIDDesc, false));
}
size_t GrGLTextureRenderTarget::onGpuMemorySize() const {
return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
this->numSamplesOwnedPerPixel(),
this->texturePriv().hasMipMaps());
}

View File

@ -12,7 +12,6 @@
#include "GrGLGpu.h"
#include "GrGLTexture.h"
#include "GrGLRenderTarget.h"
#include "GrTexturePriv.h"
class GrGLGpu;
@ -69,12 +68,7 @@ private:
this->registerWithCacheWrapped();
}
size_t onGpuMemorySize() const override {
return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
this->numSamplesOwnedPerPixel(),
this->texturePriv().hasMipMaps());
}
size_t onGpuMemorySize() const override;
};
#ifdef SK_BUILD_FOR_WIN

View File

@ -8,6 +8,7 @@
#include "GrGLSLPrimitiveProcessor.h"
#include "GrCoordTransform.h"
#include "GrTexture.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLUniformHandler.h"

View File

@ -10,7 +10,7 @@
#include "GrCaps.h"
#include "GrGeometryProcessor.h"
#include "GrGpu.h"
#include "GrProgramDesc.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryShaderBuilder.h"

View File

@ -8,7 +8,7 @@
#include "InstancedOp.h"
#include "InstanceProcessor.h"
#include "InstancedRendering.h"
#include "GrGpu.h"
#include "GrOpFlushState.h"
#include "GrRenderTargetOpList.h"

View File

@ -10,6 +10,7 @@
#include "InstancedOp.h"
#include "GrAppliedClip.h"
#include "GrCaps.h"
#include "GrGpu.h"
#include "GrPipeline.h"
#include "GrResourceProvider.h"

View File

@ -8,12 +8,12 @@
#ifndef gr_instanced_InstancedRendering_DEFINED
#define gr_instanced_InstancedRendering_DEFINED
#include "GrGpu.h"
#include "instanced/InstancedOp.h"
#include "instanced/InstancedRenderingTypes.h"
#include "SkTInternalLList.h"
class GrGpu;
class GrResourceProvider;
namespace gr_instanced {

View File

@ -6,6 +6,7 @@
*/
#include "GrCopySurfaceOp.h"
#include "GrGpu.h"
// returns true if the read/written rect intersects the src/dst and false if not.
static bool clip_src_rect_and_dst_point(const GrSurfaceProxy* dst,
@ -77,3 +78,15 @@ std::unique_ptr<GrOp> GrCopySurfaceOp::Make(GrSurfaceProxy* dstProxy, GrSurfaceP
return std::unique_ptr<GrOp>(new GrCopySurfaceOp(dstProxy, srcProxy,
clippedSrcRect, clippedDstPoint));
}
void GrCopySurfaceOp::onExecute(GrOpFlushState* state) {
SkASSERT(!state->commandBuffer());
if (!fDst.get()->instantiate(state->resourceProvider()) ||
!fSrc.get()->instantiate(state->resourceProvider())) {
return;
}
state->gpu()->copySurface(fDst.get()->priv().peekSurface(),
fSrc.get()->priv().peekSurface(), fSrcRect, fDstPoint);
}

View File

@ -53,17 +53,7 @@ private:
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState* state) override {
SkASSERT(!state->commandBuffer());
if (!fDst.get()->instantiate(state->resourceProvider()) ||
!fSrc.get()->instantiate(state->resourceProvider())) {
return;
}
state->gpu()->copySurface(fDst.get()->priv().peekSurface(),
fSrc.get()->priv().peekSurface(), fSrcRect, fDstPoint);
}
void onExecute(GrOpFlushState* state) override;
// For RenderTargetContexts 'fDst' is redundant with the RenderTarget that will be passed
// into onExecute in the drawOpArgs.

View File

@ -10,7 +10,7 @@
#include "GrPathRenderer.h"
#include "GrGpu.h"
class GrGpu;
class GrDashLinePathRenderer : public GrPathRenderer {
private:

View File

@ -10,7 +10,6 @@
#include "GrOp.h"
#include "GrOpFlushState.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetProxy.h"
class GrDiscardOp final : public GrOp {

View File

@ -9,7 +9,6 @@
#define GrDrawPathOp_DEFINED
#include "GrDrawOp.h"
#include "GrGpu.h"
#include "GrOpFlushState.h"
#include "GrPath.h"
#include "GrPathProcessor.h"

View File

@ -10,8 +10,8 @@
#include <memory>
#include "GrColor.h"
#include "GrDrawOp.h"
class GrDrawOp;
class GrPaint;
class SkMatrix;
struct SkRect;

View File

@ -16,9 +16,6 @@
#include "GrPipelineBuilder.h"
#include "GrResourceProvider.h"
#include "GrSWMaskHelper.h"
#include "GrSurfacePriv.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexturePriv.h"
#include "effects/GrBitmapTextGeoProc.h"
#include "effects/GrDistanceFieldGeoProc.h"
#include "ops/GrMeshDrawOp.h"

View File

@ -13,7 +13,6 @@
#include "GrGpu.h"
#include "GrPath.h"
#include "GrPipelineBuilder.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetContextPriv.h"
#include "GrResourceProvider.h"
#include "GrStencilPathOp.h"

View File

@ -8,7 +8,6 @@
#ifndef GrVkResourceProvider_DEFINED
#define GrVkResourceProvider_DEFINED
#include "GrGpu.h"
#include "GrResourceHandle.h"
#include "GrVkDescriptorPool.h"
#include "GrVkDescriptorSetManager.h"

View File

@ -8,7 +8,6 @@
#ifndef GrVkTexture_DEFINED
#define GrVkTexture_DEFINED
#include "GrGpu.h"
#include "GrTexture.h"
#include "GrVkImage.h"

View File

@ -8,6 +8,7 @@
#include "GrVkTextureRenderTarget.h"
#include "GrRenderTargetPriv.h"
#include "GrTexturePriv.h"
#include "GrVkGpu.h"
#include "GrVkImageView.h"
#include "GrVkUtil.h"
@ -186,3 +187,10 @@ bool GrVkTextureRenderTarget::updateForMipmap(GrVkGpu* gpu, const GrVkImageInfo&
return true;
}
size_t GrVkTextureRenderTarget::onGpuMemorySize() const {
// The plus 1 is to account for the resolve texture.
int numColorSamples = this->numColorSamples() + 1;
return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
numColorSamples, // TODO: this still correct?
this->texturePriv().hasMipMaps());
}

View File

@ -13,8 +13,6 @@
#include "GrVkRenderTarget.h"
#include "GrVkGpu.h"
#include "GrTexturePriv.h"
#ifdef SK_BUILD_FOR_WIN
// Windows gives bogus warnings about inheriting asTexture/asRenderTarget via dominance.
#pragma warning(push)
@ -113,13 +111,7 @@ private:
GrVkImage::Wrapped wrapped);
// GrGLRenderTarget accounts for the texture's memory and any MSAA renderbuffer's memory.
size_t onGpuMemorySize() const override {
// The plus 1 is to account for the resolve texture.
int numColorSamples = this->numColorSamples() + 1;
return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
numColorSamples, // TODO: this still correct?
this->texturePriv().hasMipMaps());
}
size_t onGpuMemorySize() const override;
};
#endif

View File

@ -13,8 +13,9 @@
#include "SkSurface.h"
#if SK_SUPPORT_GPU
#include "GrTexture.h"
#include "GrTextureProxy.h"
class GrTexture;
#endif
#include <new>

View File

@ -25,7 +25,7 @@
#include "GrResourceProvider.h"
#include "GrSemaphore.h"
#include "GrTextureAdjuster.h"
#include "GrTexturePriv.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "effects/GrNonlinearColorSpaceXformEffect.h"
#include "effects/GrYUVEffect.h"

View File

@ -12,7 +12,6 @@
#include "GrContext.h"
#include "GrGpuResourcePriv.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "SkAtomics.h"
#include "SkBitmap.h"
#include "SkGr.h"
@ -20,6 +19,8 @@
#include "SkImage_Base.h"
#include "SkSurface.h"
class GrTexture;
class SkImage_Gpu : public SkImage_Base {
public:
SkImage_Gpu(GrContext*, uint32_t uniqueID, SkAlphaType, sk_sp<GrTextureProxy>,

View File

@ -11,6 +11,7 @@
#include "GrContextPriv.h"
#include "GrRenderTargetContextPriv.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
#include "SkCanvas.h"
#include "SkColorSpace_Base.h"

View File

@ -10,10 +10,6 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrRenderTargetContext.h"
#include "GrGpu.h"
#include "GrRenderTarget.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
static bool check_rect(GrRenderTargetContext* rtc, const SkIRect& rect, uint32_t expectedValue,
uint32_t* actualValue, int* failX, int* failY) {

View File

@ -14,7 +14,6 @@
#include "GrResourceProvider.h"
#include "GrSurfaceContext.h"
#include "GrSurfaceProxy.h"
#include "GrTexture.h"
#include "SkUtils.h"

View File

@ -19,7 +19,6 @@
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
#include "SkHalf.h"
static const int DEV_W = 100, DEV_H = 100;

View File

@ -12,7 +12,6 @@
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
#include "GrRenderTarget.h"
#include "GrResourceProvider.h"
#include "GrTest.h"
#include "GrTexture.h"

View File

@ -182,6 +182,7 @@ DEF_TEST(ImageFilterCache_ImageBackedRaster, reporter) {
#include "GrContextPriv.h"
#include "GrResourceProvider.h"
#include "GrTest.h"
#include "GrTexture.h"
static sk_sp<GrTextureProxy> create_proxy(GrResourceProvider* resourceProvider) {
SkBitmap srcBM = create_bm();

View File

@ -36,6 +36,7 @@
#include "GrGpu.h"
#include "GrResourceCache.h"
#include "GrTest.h"
#include "GrTexture.h"
#endif
using namespace sk_gpu_test;

View File

@ -17,7 +17,6 @@
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
static const int DEV_W = 10, DEV_H = 10;
static const SkIRect DEV_RECT = SkIRect::MakeWH(DEV_W, DEV_H);

View File

@ -14,6 +14,7 @@
#include "GrRenderTargetProxy.h"
#include "GrResourceProvider.h"
#include "GrSurfaceProxy.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
static sk_sp<GrSurfaceProxy> make_wrapped_FBO0(GrResourceProvider* provider,

View File

@ -11,10 +11,10 @@
#if SK_SUPPORT_GPU
#include "GrContextPriv.h"
#include "GrRenderTargetPriv.h"
#include "GrRenderTargetProxy.h"
#include "GrResourceProvider.h"
#include "GrSurfaceProxy.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
int32_t GrIORefProxy::getProxyRefCnt_TestOnly() const {

View File

@ -16,6 +16,7 @@
#include "GrRenderTargetProxy.h"
#include "GrResourceProvider.h"
#include "GrSurfaceProxy.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
// Check that the surface proxy's member vars are set as expected

View File

@ -16,11 +16,11 @@
#include "GrGpu.h"
#include "GrGpuResourceCacheAccess.h"
#include "GrGpuResourcePriv.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetPriv.h"
#include "GrResourceCache.h"
#include "GrResourceProvider.h"
#include "GrTest.h"
#include "GrTexture.h"
#include "SkCanvas.h"
#include "SkGr.h"
#include "SkMessageBus.h"

View File

@ -7,7 +7,6 @@
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrRenderTarget.h"
#include "SkGpuDevice.h"
#include "gl/GrGLDefines.h"

View File

@ -13,6 +13,8 @@
#include "GrContextFactory.h"
#include "GrTest.h"
#include "GrTexture.h"
#include "Test.h"
#include "vk/GrVkCaps.h"
#include "vk/GrVkGpu.h"

View File

@ -20,6 +20,7 @@
#include "GrResourceCache.h"
#include "GrSemaphore.h"
#include "GrSurfaceContextPriv.h"
#include "GrTexture.h"
#include "SkGr.h"
#include "SkImage_Gpu.h"
#include "SkMathPriv.h"

View File

@ -8,7 +8,6 @@
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrRenderTarget.h"
#include "GLWindowContext.h"
#include "gl/GrGLDefines.h"

View File

@ -8,7 +8,6 @@
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrRenderTarget.h"
#include "SkAutoMalloc.h"
#include "SkSurface.h"
#include "VulkanWindowContext.h"