Retract GrTexture.h a bit

This began as cleaning up SkSpecialImage.h & spiraled out of control from there.

Change-Id: I9a570ecd2a7af9ee724ebfebe4e9185748f38bbc
Reviewed-on: https://skia-review.googlesource.com/19290
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2017-06-09 10:48:29 -04:00 committed by Skia Commit-Bot
parent a6aaa30359
commit d9d84858bf
20 changed files with 10 additions and 41 deletions

View File

@ -18,8 +18,6 @@
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrSurfaceContext.h"
#include "GrSurfaceProxy.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "../src/image/SkImage_Gpu.h"
#endif

View File

@ -78,7 +78,7 @@ public:
* If effect is non-NULL, a new GrProcessor instance is stored in it. The caller assumes
* ownership of the effect and must unref it.
*/
virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix& ctm) const;
virtual bool asFragmentProcessor(GrFragmentProcessor**) const { return false; }
/**
* If asFragmentProcessor() fails the filter may be implemented on the GPU by a subclass

View File

@ -8,8 +8,8 @@
#ifndef GrTextureProxy_DEFINED
#define GrTextureProxy_DEFINED
#include "GrSamplerParams.h"
#include "GrSurfaceProxy.h"
#include "GrTexture.h"
class GrCaps;
class GrResourceProvider;

View File

@ -16,9 +16,7 @@
#include "SkRasterClip.h"
#if SK_SUPPORT_GPU
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "SkGr.h"
#endif
SkMaskFilter::NinePatch::~NinePatch() {
@ -303,10 +301,6 @@ SkMaskFilter::filterRectsToNine(const SkRect[], int count, const SkMatrix&,
}
#if SK_SUPPORT_GPU
bool SkMaskFilter::asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&) const {
return false;
}
bool SkMaskFilter::canFilterMaskGPU(const SkRRect& devRRect,
const SkIRect& clipBounds,
const SkMatrix& ctm,

View File

@ -20,11 +20,7 @@
#include "GrContextPriv.h"
#include "GrResourceProvider.h"
#include "GrSurfaceContext.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "GrSamplerParams.h"
#include "GrTextureProxy.h"
#include "SkGr.h"
#include "SkImage_Gpu.h"
#endif
@ -342,8 +338,6 @@ sk_sp<SkSpecialImage> SkSpecialImage::MakeFromRaster(const SkIRect& subset,
#if SK_SUPPORT_GPU
///////////////////////////////////////////////////////////////////////////////
#include "GrTexture.h"
static sk_sp<SkImage> wrap_proxy_in_image(GrContext* context, sk_sp<GrTextureProxy> proxy,
SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace) {
return sk_make_sp<SkImage_Gpu>(context, kNeedNewImageUniqueID, alphaType,

View File

@ -16,8 +16,6 @@
#include "SkImageInfo.h" // for SkAlphaType
class GrContext;
class GrSurfaceProxy;
class GrTexture;
class GrTextureProxy;
class SkBitmap;
class SkCanvas;
@ -119,7 +117,6 @@ public:
*/
sk_sp<SkImage> asImage(const SkIRect* subset = nullptr) const;
// TODO: hide this when GrLayerHoister uses SkSpecialImages more fully (see skbug.com/5063)
/**
* If the SpecialImage is backed by a gpu texture, return true.
*/
@ -138,7 +135,6 @@ public:
sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*) const;
#endif
// TODO: hide this whe the imagefilter all have a consistent draw path (see skbug.com/5063)
/**
* Regardless of the underlying backing store, return the contents as an SkBitmap
*

View File

@ -25,7 +25,6 @@
#include "GrResourceProvider.h"
#include "GrShaderCaps.h"
#include "GrStyle.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "effects/GrSimpleTextureEffect.h"
#include "glsl/GrGLSLFragmentProcessor.h"

View File

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

View File

@ -33,7 +33,7 @@ public:
SkIPoint* margin) const override;
#if SK_SUPPORT_GPU
bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix& ctm) const override;
bool asFragmentProcessor(GrFragmentProcessor**) const override;
#endif
SK_TO_STRING_OVERRIDE()
@ -494,9 +494,7 @@ private:
};
////////////////////////////////////////////////////////////////////////////
bool SkRRectsGaussianEdgeMaskFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp,
GrTexture*, const
SkMatrix& ctm) const {
bool SkRRectsGaussianEdgeMaskFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp) const {
if (fp) {
*fp = new RRectsGaussianEdgeFP(fFirst, fSecond, fRadius);
}

View File

@ -15,7 +15,6 @@
#include "GrResourceProvider.h"
#include "effects/GrSimpleTextureEffect.h"
#include "GrStyle.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "SkDraw.h"
#include "SkGr.h"
@ -302,7 +301,7 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
}
GrAA aa = GrBoolToAA(paint.isAntiAlias());
SkMaskFilter* mf = paint.getMaskFilter();
if (mf && !mf->asFragmentProcessor(nullptr, nullptr, viewMatrix)) {
if (mf && !mf->asFragmentProcessor(nullptr)) {
// The MaskFilter wasn't already handled in SkPaintToGrPaint
draw_path_with_mask_filter(context, renderTargetContext, clip, std::move(grPaint), aa,
viewMatrix, mf, style, path, pathIsMutable);

View File

@ -8,10 +8,7 @@
#include "GrTextureAdjuster.h"
#include "GrContext.h"
#include "GrGpu.h"
#include "GrGpuResourcePriv.h"
#include "GrResourceProvider.h"
#include "GrTexture.h"
#include "SkGr.h"
GrTextureAdjuster::GrTextureAdjuster(GrContext* context, sk_sp<GrTextureProxy> original,

View File

@ -9,9 +9,7 @@
#include "GrClip.h"
#include "GrRenderTargetContext.h"
#include "GrResourceProvider.h"
#include "GrSurfaceProxy.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
#include "effects/GrBicubicEffect.h"
#include "effects/GrSimpleTextureEffect.h"
#include "effects/GrTextureDomain.h"

View File

@ -26,7 +26,7 @@ GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(const GrCaps& caps,
// GrRenderTargetProxy) so its constructor must be explicitly called.
GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(sk_sp<GrSurface> surf)
: GrSurfaceProxy(surf, SkBackingFit::kExact)
, GrTextureProxy(sk_ref_sp(surf->asTexture()))
, GrTextureProxy(surf)
, GrRenderTargetProxy(sk_ref_sp(surf->asRenderTarget())) {
SkASSERT(surf->asTexture());
SkASSERT(surf->asRenderTarget());

View File

@ -13,7 +13,6 @@
#include "GrNonAtomicRef.h"
#include "GrProcessor.h"
#include "GrProcessorAnalysis.h"
#include "GrTexture.h"
#include "GrTypes.h"
class GrGLSLXferProcessor;

View File

@ -412,7 +412,7 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
}
SkMaskFilter* mf = paint.getMaskFilter();
if (mf && mf->asFragmentProcessor(nullptr, nullptr, this->ctm())) {
if (mf && mf->asFragmentProcessor(nullptr)) {
mf = nullptr; // already handled in SkPaintToGrPaint
}

View File

@ -529,7 +529,7 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
SkMaskFilter* maskFilter = skPaint.getMaskFilter();
if (maskFilter) {
GrFragmentProcessor* mfFP;
if (maskFilter->asFragmentProcessor(&mfFP, nullptr, viewM)) {
if (maskFilter->asFragmentProcessor(&mfFP)) {
grPaint->addCoverageFragmentProcessor(sk_sp<GrFragmentProcessor>(mfFP));
}
}

View File

@ -13,7 +13,6 @@
#include "GrPipeline.h"
#include "GrProcessor.h"
#include "GrShaderCaps.h"
#include "GrTexture.h"
#include "glsl/GrGLSLBlend.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"

View File

@ -7,7 +7,6 @@
#include "GrSimpleTextureEffect.h"
#include "GrProxyMove.h"
#include "GrTexture.h"
#include "glsl/GrGLSLColorSpaceXformHelper.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"

View File

@ -14,7 +14,6 @@
#include "GrProgramDesc.h"
#include "GrShaderCaps.h"
#include "GrSwizzle.h"
#include "GrTexture.h"
#include "SkAutoMalloc.h"
#include "SkATrace.h"
#include "SkTraceEvent.h"

View File

@ -17,6 +17,7 @@
#include "GrReducedClip.h"
#include "GrResourceCache.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "GrTextureProxy.h"
typedef GrReducedClip::ElementList ElementList;
typedef GrReducedClip::InitialState InitialState;