Remove GrAddPathRenderers_default
BUG=skia: Review URL: https://codereview.chromium.org/1311673014
This commit is contained in:
parent
4f588b5b61
commit
0cffb171eb
@ -55,7 +55,6 @@
|
||||
'<(skia_include_path)/gpu/gl/GrGLInterface.h',
|
||||
'<(skia_include_path)/gpu/gl/GrGLSLPrettyPrint.h',
|
||||
|
||||
'<(skia_src_path)/gpu/GrAddPathRenderers_default.cpp',
|
||||
'<(skia_src_path)/gpu/GrAutoLocaleSetter.h',
|
||||
'<(skia_src_path)/gpu/GrAllocator.h',
|
||||
'<(skia_src_path)/gpu/GrAtlas.cpp',
|
||||
@ -90,8 +89,6 @@
|
||||
'<(skia_src_path)/gpu/GrCoordTransform.cpp',
|
||||
'<(skia_src_path)/gpu/GrDefaultGeoProcFactory.cpp',
|
||||
'<(skia_src_path)/gpu/GrDefaultGeoProcFactory.h',
|
||||
'<(skia_src_path)/gpu/GrDefaultPathRenderer.cpp',
|
||||
'<(skia_src_path)/gpu/GrDefaultPathRenderer.h',
|
||||
'<(skia_src_path)/gpu/GrDrawContext.cpp',
|
||||
'<(skia_src_path)/gpu/GrDrawTarget.cpp',
|
||||
'<(skia_src_path)/gpu/GrDrawTarget.h',
|
||||
@ -223,6 +220,8 @@
|
||||
'<(skia_src_path)/gpu/batches/GrCopySurfaceBatch.h',
|
||||
'<(skia_src_path)/gpu/batches/GrDashLinePathRenderer.cpp',
|
||||
'<(skia_src_path)/gpu/batches/GrDashLinePathRenderer.h',
|
||||
'<(skia_src_path)/gpu/batches/GrDefaultPathRenderer.cpp',
|
||||
'<(skia_src_path)/gpu/batches/GrDefaultPathRenderer.h',
|
||||
'<(skia_src_path)/gpu/batches/GrDiscardBatch.h',
|
||||
'<(skia_src_path)/gpu/batches/GrDrawBatch.cpp',
|
||||
'<(skia_src_path)/gpu/batches/GrDrawBatch.h',
|
||||
|
@ -1,35 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright 2012 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
#include "GrContext.h"
|
||||
#include "GrGpu.h"
|
||||
|
||||
#include "batches/GrAAConvexPathRenderer.h"
|
||||
#include "batches/GrAAHairLinePathRenderer.h"
|
||||
#include "batches/GrAALinearizingConvexPathRenderer.h"
|
||||
#include "batches/GrAADistanceFieldPathRenderer.h"
|
||||
#include "batches/GrDashLinePathRenderer.h"
|
||||
#include "batches/GrStencilAndCoverPathRenderer.h"
|
||||
#include "batches/GrTessellatingPathRenderer.h"
|
||||
|
||||
void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
|
||||
chain->addPathRenderer(new GrDashLinePathRenderer)->unref();
|
||||
|
||||
if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resourceProvider(),
|
||||
*ctx->caps())) {
|
||||
chain->addPathRenderer(pr)->unref();
|
||||
}
|
||||
chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
|
||||
if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) {
|
||||
chain->addPathRenderer(pr)->unref();
|
||||
}
|
||||
chain->addPathRenderer(new GrAAConvexPathRenderer)->unref();
|
||||
chain->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
|
||||
chain->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
|
||||
}
|
@ -30,20 +30,6 @@ struct GrPoint;
|
||||
*/
|
||||
class SK_API GrPathRenderer : public SkRefCnt {
|
||||
public:
|
||||
|
||||
|
||||
/**
|
||||
* This is called to install custom path renderers in every GrContext at create time. The
|
||||
* default implementation in GrCreatePathRenderer_none.cpp does not add any additional
|
||||
* renderers. Link against another implementation to install your own. The first added is the
|
||||
* most preferred path renderer, second is second most preferred, etc.
|
||||
*
|
||||
* @param context the context that will use the path renderer
|
||||
* @param prChain the chain to add path renderers to.
|
||||
*/
|
||||
static void AddPathRenderers(GrContext* context, GrPathRendererChain* prChain);
|
||||
|
||||
|
||||
GrPathRenderer();
|
||||
|
||||
/**
|
||||
|
@ -11,9 +11,17 @@
|
||||
|
||||
#include "GrCaps.h"
|
||||
#include "GrContext.h"
|
||||
#include "GrDefaultPathRenderer.h"
|
||||
#include "GrGpu.h"
|
||||
|
||||
#include "batches/GrAAConvexPathRenderer.h"
|
||||
#include "batches/GrAADistanceFieldPathRenderer.h"
|
||||
#include "batches/GrAAHairLinePathRenderer.h"
|
||||
#include "batches/GrAALinearizingConvexPathRenderer.h"
|
||||
#include "batches/GrDashLinePathRenderer.h"
|
||||
#include "batches/GrDefaultPathRenderer.h"
|
||||
#include "batches/GrStencilAndCoverPathRenderer.h"
|
||||
#include "batches/GrTessellatingPathRenderer.h"
|
||||
|
||||
GrPathRendererChain::GrPathRendererChain(GrContext* context)
|
||||
: fInit(false)
|
||||
, fOwner(context) {
|
||||
@ -85,10 +93,19 @@ GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target,
|
||||
|
||||
void GrPathRendererChain::init() {
|
||||
SkASSERT(!fInit);
|
||||
const GrCaps* caps = fOwner->caps();
|
||||
bool twoSided = caps->twoSidedStencilSupport();
|
||||
bool wrapOp = caps->stencilWrapOpsSupport();
|
||||
GrPathRenderer::AddPathRenderers(fOwner, this);
|
||||
this->addPathRenderer(new GrDefaultPathRenderer(twoSided, wrapOp))->unref();
|
||||
const GrCaps& caps = *fOwner->caps();
|
||||
this->addPathRenderer(new GrDashLinePathRenderer)->unref();
|
||||
|
||||
if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(fOwner->resourceProvider(),
|
||||
caps)) {
|
||||
this->addPathRenderer(pr)->unref();
|
||||
}
|
||||
this->addPathRenderer(new GrTessellatingPathRenderer)->unref();
|
||||
this->addPathRenderer(new GrAAHairLinePathRenderer)->unref();
|
||||
this->addPathRenderer(new GrAAConvexPathRenderer)->unref();
|
||||
this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
|
||||
this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
|
||||
this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(),
|
||||
caps.stencilWrapOpsSupport()))->unref();
|
||||
fInit = true;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
class GrAAHairLinePathRenderer : public GrPathRenderer {
|
||||
public:
|
||||
static GrPathRenderer* Create() { return new GrAAHairLinePathRenderer; }
|
||||
GrAAHairLinePathRenderer() {}
|
||||
|
||||
typedef SkTArray<SkPoint, true> PtArray;
|
||||
typedef SkTArray<int, true> IntArray;
|
||||
@ -24,8 +24,6 @@ private:
|
||||
|
||||
bool onDrawPath(const DrawPathArgs&) override;
|
||||
|
||||
GrAAHairLinePathRenderer() {}
|
||||
|
||||
typedef GrPathRenderer INHERITED;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user