Remove GrTextTarget and GrRenderTargetContext::TextTarget
Change-Id: I501f2fc365c0d2f2faff6ffaf4ad09635e4c3cdf Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301452 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
parent
fcfd0af9fd
commit
60a4986d4c
@ -479,7 +479,6 @@ skia_gpu_sources = [
|
||||
"$_src/gpu/text/GrTextBlob.h",
|
||||
"$_src/gpu/text/GrTextBlobCache.cpp",
|
||||
"$_src/gpu/text/GrTextBlobCache.h",
|
||||
"$_src/gpu/text/GrTextTarget.h",
|
||||
|
||||
# GLSL
|
||||
"$_src/gpu/glsl/GrGLSL.cpp",
|
||||
|
@ -69,56 +69,6 @@
|
||||
#include "src/gpu/ops/GrTextureOp.h"
|
||||
#include "src/gpu/text/GrSDFTOptions.h"
|
||||
#include "src/gpu/text/GrTextBlobCache.h"
|
||||
#include "src/gpu/text/GrTextTarget.h"
|
||||
|
||||
class GrRenderTargetContext::TextTarget : public GrTextTarget {
|
||||
public:
|
||||
TextTarget(GrRenderTargetContext* renderTargetContext)
|
||||
: GrTextTarget(renderTargetContext->width(), renderTargetContext->height(),
|
||||
renderTargetContext->colorInfo())
|
||||
, fRenderTargetContext(renderTargetContext) {}
|
||||
|
||||
void addDrawOp(const GrClip* clip, std::unique_ptr<GrAtlasTextOp> op) override {
|
||||
fRenderTargetContext->addDrawOp(clip, std::move(op));
|
||||
}
|
||||
|
||||
void drawShape(const GrClip* clip,
|
||||
const SkPaint& paint,
|
||||
const SkMatrixProvider& matrixProvider,
|
||||
const GrStyledShape& shape) override {
|
||||
GrBlurUtils::drawShapeWithMaskFilter(fRenderTargetContext->fContext, fRenderTargetContext,
|
||||
clip, paint, matrixProvider, shape);
|
||||
}
|
||||
|
||||
void makeGrPaint(GrMaskFormat maskFormat,
|
||||
const SkPaint& skPaint,
|
||||
const SkMatrixProvider& matrixProvider,
|
||||
GrPaint* grPaint) override {
|
||||
auto context = fRenderTargetContext->fContext;
|
||||
const GrColorInfo& colorInfo = fRenderTargetContext->colorInfo();
|
||||
if (kARGB_GrMaskFormat == maskFormat) {
|
||||
SkPaintToGrPaintWithPrimitiveColor(context, colorInfo, skPaint, matrixProvider,
|
||||
grPaint);
|
||||
} else {
|
||||
SkPaintToGrPaint(context, colorInfo, skPaint, matrixProvider, grPaint);
|
||||
}
|
||||
}
|
||||
|
||||
GrRecordingContext* getContext() override {
|
||||
return fRenderTargetContext->fContext;
|
||||
}
|
||||
|
||||
GrRenderTargetContext* renderTargetContext() override {
|
||||
return fRenderTargetContext;
|
||||
}
|
||||
|
||||
SkGlyphRunListPainter* glyphPainter() override {
|
||||
return fRenderTargetContext->glyphPainter();
|
||||
}
|
||||
|
||||
private:
|
||||
GrRenderTargetContext* fRenderTargetContext;
|
||||
};
|
||||
|
||||
#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this->drawingManager()->getContext())
|
||||
#define ASSERT_SINGLE_OWNER GR_ASSERT_SINGLE_OWNER(this->singleOwner())
|
||||
@ -390,7 +340,6 @@ GrRenderTargetContext::GrRenderTargetContext(GrRecordingContext* context,
|
||||
SkASSERT(this->asSurfaceProxy() == fWriteView.proxy());
|
||||
SkASSERT(this->origin() == fWriteView.origin());
|
||||
|
||||
fTextTarget.reset(new TextTarget(this));
|
||||
SkDEBUGCODE(this->validate();)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "src/gpu/GrSurfaceProxyView.h"
|
||||
#include "src/gpu/GrXferProcessor.h"
|
||||
#include "src/gpu/geometry/GrQuad.h"
|
||||
#include "src/gpu/text/GrTextTarget.h"
|
||||
|
||||
class GrBackendSemaphore;
|
||||
class GrClip;
|
||||
@ -550,8 +549,6 @@ public:
|
||||
GrRenderTargetContextPriv priv();
|
||||
const GrRenderTargetContextPriv priv() const;
|
||||
|
||||
GrTextTarget* textTarget() { return fTextTarget.get(); }
|
||||
|
||||
void wasClosed(const GrOpsTask& task) override;
|
||||
|
||||
#if GR_TEST_UTILS
|
||||
@ -561,7 +558,6 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
class TextTarget;
|
||||
enum class QuadOptimization;
|
||||
|
||||
GrAAType chooseAAType(GrAA);
|
||||
@ -674,8 +670,6 @@ private:
|
||||
|
||||
SkGlyphRunListPainter* glyphPainter() { return &fGlyphPainter; }
|
||||
|
||||
std::unique_ptr<GrTextTarget> fTextTarget;
|
||||
|
||||
GrSurfaceProxyView fWriteView;
|
||||
|
||||
// In MDB-mode the GrOpsTask can be closed by some other renderTargetContext that has picked
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "src/gpu/GrTracing.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/geometry/GrStyledShape.h"
|
||||
#include "src/gpu/text/GrTextTarget.h"
|
||||
#include "src/image/SkImage_Base.h"
|
||||
#include "src/image/SkReadPixelsRec.h"
|
||||
#include "src/image/SkSurface_Gpu.h"
|
||||
|
@ -21,12 +21,10 @@
|
||||
#include "src/gpu/text/GrAtlasManager.h"
|
||||
#include "src/gpu/text/GrStrikeCache.h"
|
||||
#include "src/gpu/text/GrTextBlob.h"
|
||||
#include "src/gpu/text/GrTextTarget.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <new>
|
||||
|
||||
|
||||
// -- GrTextBlob::Key ------------------------------------------------------------------------------
|
||||
GrTextBlob::Key::Key() { sk_bzero(this, sizeof(Key)); }
|
||||
|
||||
|
@ -27,7 +27,6 @@ class GrAtlasTextOp;
|
||||
class GrDeferredUploadTarget;
|
||||
class GrGlyph;
|
||||
class GrStrikeCache;
|
||||
class GrTextTarget;
|
||||
|
||||
class SkMatrixProvider;
|
||||
class SkSurfaceProps;
|
||||
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef GrTextTarget_DEFINED
|
||||
#define GrTextTarget_DEFINED
|
||||
|
||||
#include "include/core/SkPaint.h"
|
||||
#include "src/gpu/GrColorInfo.h"
|
||||
|
||||
class GrAtlasTextOp;
|
||||
class GrClip;
|
||||
class GrPaint;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrStyledShape;
|
||||
class SkGlyphRunListPainter;
|
||||
class SkMatrix;
|
||||
class SkMatrixProvider;
|
||||
struct SkIRect;
|
||||
|
||||
class GrTextTarget {
|
||||
public:
|
||||
virtual ~GrTextTarget() = default;
|
||||
|
||||
int width() const { return fWidth; }
|
||||
|
||||
int height() const { return fHeight; }
|
||||
|
||||
const GrColorInfo& colorInfo() const { return fColorInfo; }
|
||||
|
||||
virtual void addDrawOp(const GrClip*, std::unique_ptr<GrAtlasTextOp> op) = 0;
|
||||
|
||||
virtual void drawShape(const GrClip*,
|
||||
const SkPaint&,
|
||||
const SkMatrixProvider&,
|
||||
const GrStyledShape&) = 0;
|
||||
|
||||
virtual void makeGrPaint(GrMaskFormat,
|
||||
const SkPaint&,
|
||||
const SkMatrixProvider&,
|
||||
GrPaint*) = 0;
|
||||
|
||||
virtual GrRecordingContext* getContext() = 0;
|
||||
|
||||
virtual GrRenderTargetContext* renderTargetContext() = 0;
|
||||
|
||||
virtual SkGlyphRunListPainter* glyphPainter() = 0;
|
||||
|
||||
protected:
|
||||
GrTextTarget(int width, int height, const GrColorInfo& colorInfo)
|
||||
: fWidth(width), fHeight(height), fColorInfo(colorInfo) {
|
||||
SkASSERT(kPremul_SkAlphaType == colorInfo.alphaType());
|
||||
}
|
||||
|
||||
private:
|
||||
int fWidth;
|
||||
int fHeight;
|
||||
const GrColorInfo& fColorInfo;
|
||||
};
|
||||
#endif // GrTextTarget_DEFINED
|
Loading…
Reference in New Issue
Block a user