Revert of Store context options on caps. (patchset #3 id:40001 of https://codereview.chromium.org/1158433006/)
Reason for revert: breaking chromeos build (???) Original issue's description: > Store context options on caps. > > Committed: https://skia.googlesource.com/skia/+/f28cff71db2cbb1ff18a8fbf1e80ca761d1f69bc TBR=joshualitt@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1151603005
This commit is contained in:
parent
f28cff71db
commit
08bf86d1b7
@ -47,8 +47,6 @@
|
||||
SkAutoTDelete<GrContextFactory> gGrFactory;
|
||||
#endif
|
||||
|
||||
struct GrContextOptions;
|
||||
|
||||
__SK_FORCE_IMAGE_DECODER_LINKING;
|
||||
|
||||
static const int kAutoTuneLoops = 0;
|
||||
@ -846,7 +844,7 @@ int nanobench_main() {
|
||||
SkTaskGroup::Enabler enabled;
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
GrContextOptions grContextOpts;
|
||||
GrContext::Options grContextOpts;
|
||||
grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks;
|
||||
gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts)));
|
||||
#endif
|
||||
|
@ -16,7 +16,6 @@
|
||||
'<(skia_include_path)/gpu/GrClip.h',
|
||||
'<(skia_include_path)/gpu/GrColor.h',
|
||||
'<(skia_include_path)/gpu/GrConfig.h',
|
||||
'<(skia_include_path)/gpu/GrContextOptions.h',
|
||||
'<(skia_include_path)/gpu/GrContext.h',
|
||||
'<(skia_include_path)/gpu/GrCoordTransform.h',
|
||||
'<(skia_include_path)/gpu/GrFragmentProcessor.h',
|
||||
|
@ -14,8 +14,6 @@
|
||||
#include "SkRefCnt.h"
|
||||
#include "SkString.h"
|
||||
|
||||
struct GrContextOptions;
|
||||
|
||||
class GrShaderCaps : public SkRefCnt {
|
||||
public:
|
||||
SK_DECLARE_INST_COUNT(GrShaderCaps)
|
||||
@ -105,7 +103,7 @@ class GrCaps : public SkRefCnt {
|
||||
public:
|
||||
SK_DECLARE_INST_COUNT(GrCaps)
|
||||
|
||||
GrCaps(const GrContextOptions&);
|
||||
GrCaps();
|
||||
|
||||
virtual SkString dump() const;
|
||||
|
||||
@ -188,11 +186,6 @@ public:
|
||||
return fConfigTextureSupport[config];
|
||||
}
|
||||
|
||||
bool suppressPrints() const { return fSupressPrints; }
|
||||
|
||||
bool drawPathMasksToCompressedTexturesSupport() const {
|
||||
return fDrawPathMasksToCompressedTextureSupport; }
|
||||
|
||||
protected:
|
||||
SkAutoTUnref<GrShaderCaps> fShaderCaps;
|
||||
|
||||
@ -221,9 +214,6 @@ protected:
|
||||
bool fConfigTextureSupport[kGrPixelConfigCnt];
|
||||
|
||||
private:
|
||||
bool fSupressPrints : 1;
|
||||
bool fDrawPathMasksToCompressedTextureSupport : 1;
|
||||
|
||||
typedef SkRefCnt INHERITED;
|
||||
};
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
class GrAARectRenderer;
|
||||
class GrBatchFontCache;
|
||||
struct GrContextOptions;
|
||||
class GrDrawTarget;
|
||||
class GrFragmentProcessor;
|
||||
class GrGpu;
|
||||
@ -47,11 +46,20 @@ class SK_API GrContext : public SkRefCnt {
|
||||
public:
|
||||
SK_DECLARE_INST_COUNT(GrContext)
|
||||
|
||||
struct Options {
|
||||
Options() : fDrawPathToCompressedTexture(false), fSuppressPrints(false) { }
|
||||
|
||||
// EXPERIMENTAL
|
||||
// May be removed in the future, or may become standard depending
|
||||
// on the outcomes of a variety of internal tests.
|
||||
bool fDrawPathToCompressedTexture;
|
||||
bool fSuppressPrints;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a GrContext for a backend context.
|
||||
*/
|
||||
static GrContext* Create(GrBackend, GrBackendContext, const GrContextOptions& options);
|
||||
static GrContext* Create(GrBackend, GrBackendContext);
|
||||
static GrContext* Create(GrBackend, GrBackendContext, const Options* opts = NULL);
|
||||
|
||||
/**
|
||||
* Only defined in test apps.
|
||||
@ -522,6 +530,7 @@ public:
|
||||
GrResourceProvider* resourceProvider() { return fResourceProvider; }
|
||||
const GrResourceProvider* resourceProvider() const { return fResourceProvider; }
|
||||
GrResourceCache* getResourceCache() { return fResourceCache; }
|
||||
bool suppressPrints() const { return fOptions.fSuppressPrints; }
|
||||
|
||||
// Called by tests that draw directly to the context via GrDrawTarget
|
||||
void getTestTarget(GrTestTarget*);
|
||||
@ -539,6 +548,12 @@ public:
|
||||
GrPathRendererChain::DrawType drawType = GrPathRendererChain::kColor_DrawType,
|
||||
GrPathRendererChain::StencilSupport* stencilSupport = NULL);
|
||||
|
||||
/**
|
||||
* This returns a copy of the the GrContext::Options that was passed to the
|
||||
* constructor of this class.
|
||||
*/
|
||||
const Options& getOptions() const { return fOptions; }
|
||||
|
||||
/** Prints cache stats to the string if GR_CACHE_STATS == 1. */
|
||||
void dumpCacheStats(SkString*) const;
|
||||
void printCacheStats() const;
|
||||
@ -584,10 +599,11 @@ private:
|
||||
|
||||
int fMaxTextureSizeOverride;
|
||||
|
||||
const Options fOptions;
|
||||
const uint32_t fUniqueID;
|
||||
|
||||
GrContext(); // init must be called after the constructor.
|
||||
bool init(GrBackend, GrBackendContext, const GrContextOptions& options);
|
||||
GrContext(const Options&); // init must be called after the constructor.
|
||||
bool init(GrBackend, GrBackendContext);
|
||||
void initMockContext();
|
||||
void initCommon();
|
||||
|
||||
|
@ -1,24 +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 GrContextOptions_DEFINED
|
||||
#define GrContextOptions_DEFINED
|
||||
|
||||
#include "GrTypes.h"
|
||||
|
||||
struct GrContextOptions {
|
||||
GrContextOptions() : fDrawPathToCompressedTexture(false), fSuppressPrints(false) {}
|
||||
|
||||
// EXPERIMENTAL
|
||||
// May be removed in the future, or may become standard depending
|
||||
// on the outcomes of a variety of internal tests.
|
||||
bool fDrawPathToCompressedTexture;
|
||||
// Suppress prints for the GrContext.
|
||||
bool fSuppressPrints;
|
||||
};
|
||||
|
||||
#endif
|
@ -265,13 +265,13 @@ private:
|
||||
};
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
// Takes a pointer to a GrCaps, and will suppress prints if required
|
||||
#define GrCapsDebugf(caps, ...) \
|
||||
if (!caps->suppressPrints()) { \
|
||||
SkDebugf(__VA_ARGS__); \
|
||||
// Takes a pointer to a GrContext, and will suppress prints if required
|
||||
#define GrContextDebugf(context, ...) \
|
||||
if (!context->suppressPrints()) { \
|
||||
SkDebugf(__VA_ARGS__); \
|
||||
}
|
||||
#else
|
||||
#define GrCapsDebugf(caps, ...)
|
||||
#define GrContextDebugf(context, ...)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "GrBatchTarget.h"
|
||||
#include "GrBatchTest.h"
|
||||
#include "GrCaps.h"
|
||||
#include "GrContextOptions.h"
|
||||
#include "GrDefaultGeoProcFactory.h"
|
||||
#include "GrGpuResource.h"
|
||||
#include "GrGpuResourcePriv.h"
|
||||
@ -71,16 +70,16 @@ private:
|
||||
GrContext* fContext;
|
||||
};
|
||||
|
||||
GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext) {
|
||||
GrContextOptions defaultOptions;
|
||||
return Create(backend, backendContext, defaultOptions);
|
||||
}
|
||||
|
||||
GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext,
|
||||
const GrContextOptions& options) {
|
||||
GrContext* context = SkNEW(GrContext);
|
||||
const Options* opts) {
|
||||
GrContext* context;
|
||||
if (NULL == opts) {
|
||||
context = SkNEW_ARGS(GrContext, (Options()));
|
||||
} else {
|
||||
context = SkNEW_ARGS(GrContext, (*opts));
|
||||
}
|
||||
|
||||
if (context->init(backend, backendContext, options)) {
|
||||
if (context->init(backend, backendContext)) {
|
||||
return context;
|
||||
} else {
|
||||
context->unref();
|
||||
@ -97,7 +96,7 @@ static int32_t next_id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
GrContext::GrContext() : fUniqueID(next_id()) {
|
||||
GrContext::GrContext(const Options& opts) : fOptions(opts), fUniqueID(next_id()) {
|
||||
fGpu = NULL;
|
||||
fResourceCache = NULL;
|
||||
fResourceProvider = NULL;
|
||||
@ -111,11 +110,10 @@ GrContext::GrContext() : fUniqueID(next_id()) {
|
||||
fMaxTextureSizeOverride = 1 << 20;
|
||||
}
|
||||
|
||||
bool GrContext::init(GrBackend backend, GrBackendContext backendContext,
|
||||
const GrContextOptions& options) {
|
||||
bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
|
||||
SkASSERT(NULL == fGpu);
|
||||
|
||||
fGpu = GrGpu::Create(backend, backendContext, options, this);
|
||||
fGpu = GrGpu::Create(backend, backendContext, this);
|
||||
if (NULL == fGpu) {
|
||||
return false;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI)
|
||||
|
||||
glCtx->makeCurrent();
|
||||
GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get());
|
||||
grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions));
|
||||
grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, &fGlobalOptions));
|
||||
if (!grCtx.get()) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#define GrContextFactory_DEFINED
|
||||
|
||||
#include "GrContext.h"
|
||||
#include "GrContextOptions.h"
|
||||
|
||||
#include "gl/SkGLContext.h"
|
||||
#include "SkTArray.h"
|
||||
@ -81,7 +80,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
explicit GrContextFactory(const GrContextOptions& opts) : fGlobalOptions(opts) { }
|
||||
explicit GrContextFactory(const GrContext::Options& opts) : fGlobalOptions(opts) { }
|
||||
GrContextFactory() { }
|
||||
|
||||
~GrContextFactory() { this->destroyContexts(); }
|
||||
@ -127,7 +126,7 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const GrContextOptions& getGlobalOptions() const { return fGlobalOptions; }
|
||||
const GrContext::Options& getGlobalOptions() const { return fGlobalOptions; }
|
||||
|
||||
private:
|
||||
struct GPUContext {
|
||||
@ -136,7 +135,7 @@ private:
|
||||
GrContext* fGrContext;
|
||||
};
|
||||
SkTArray<GPUContext, true> fContexts;
|
||||
const GrContextOptions fGlobalOptions;
|
||||
const GrContext::Options fGlobalOptions;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "GrBatch.h"
|
||||
#include "GrCaps.h"
|
||||
#include "GrContext.h"
|
||||
#include "GrContextOptions.h"
|
||||
#include "GrPath.h"
|
||||
#include "GrPipeline.h"
|
||||
#include "GrMemoryPool.h"
|
||||
@ -69,8 +68,8 @@ bool GrDrawTarget::setupDstReadIfNecessary(const GrPipelineBuilder& pipelineBuil
|
||||
drawBounds->roundOut(&drawIBounds);
|
||||
if (!copyRect.intersect(drawIBounds)) {
|
||||
#ifdef SK_DEBUG
|
||||
GrCapsDebugf(fCaps, "Missed an early reject. "
|
||||
"Bailing on draw from setupDstReadIfNecessary.\n");
|
||||
GrContextDebugf(fContext, "Missed an early reject. "
|
||||
"Bailing on draw from setupDstReadIfNecessary.\n");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@ -599,7 +598,7 @@ SkString GrShaderCaps::dump() const {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GrCaps::GrCaps(const GrContextOptions& options) {
|
||||
GrCaps::GrCaps() {
|
||||
fMipMapSupport = false;
|
||||
fNPOTTextureTileSupport = false;
|
||||
fTwoSidedStencilSupport = false;
|
||||
@ -622,9 +621,6 @@ GrCaps::GrCaps(const GrContextOptions& options) {
|
||||
|
||||
memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport));
|
||||
memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport));
|
||||
|
||||
fSupressPrints = options.fSuppressPrints;
|
||||
fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedTexture;
|
||||
}
|
||||
|
||||
static SkString map_flags_to_string(uint32_t flags) {
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
* not supported (at compile-time or run-time) this returns NULL. The context will not be
|
||||
* fully constructed and should not be used by GrGpu until after this function returns.
|
||||
*/
|
||||
static GrGpu* Create(GrBackend, GrBackendContext, const GrContextOptions&, GrContext* context);
|
||||
static GrGpu* Create(GrBackend, GrBackendContext, GrContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -20,13 +20,10 @@ GrGpuFactoryRegistrar::GrGpuFactoryRegistrar(int i, CreateGpuProc proc) {
|
||||
gGpuFactories[i] = proc;
|
||||
}
|
||||
|
||||
GrGpu* GrGpu::Create(GrBackend backend,
|
||||
GrBackendContext backendContext,
|
||||
const GrContextOptions& options,
|
||||
GrContext* context) {
|
||||
GrGpu* GrGpu::Create(GrBackend backend, GrBackendContext backendContext, GrContext* context) {
|
||||
SkASSERT((int)backend < kMaxNumBackends);
|
||||
if (!gGpuFactories[backend]) {
|
||||
return NULL;
|
||||
}
|
||||
return (gGpuFactories[backend])(backendContext, options, context);
|
||||
return (gGpuFactories[backend])(backendContext, context);
|
||||
}
|
||||
|
@ -12,9 +12,8 @@
|
||||
|
||||
class GrGpu;
|
||||
class GrContext;
|
||||
struct GrContextOptions;
|
||||
|
||||
typedef GrGpu* (*CreateGpuProc)(GrBackendContext, const GrContextOptions& options, GrContext*);
|
||||
typedef GrGpu* (*CreateGpuProc)(GrBackendContext, GrContext*);
|
||||
|
||||
class GrGpuFactoryRegistrar {
|
||||
public:
|
||||
|
@ -174,7 +174,7 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds,
|
||||
resultBounds.height());
|
||||
|
||||
if (allowCompression &&
|
||||
fContext->getGpu()->caps()->drawPathMasksToCompressedTexturesSupport() &&
|
||||
fContext->getOptions().fDrawPathToCompressedTexture &&
|
||||
choose_compressed_fmt(fContext->getGpu()->caps(), &fCompressedFormat)) {
|
||||
fCompressionMode = kCompress_CompressionMode;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "GrTest.h"
|
||||
#include "GrContextOptions.h"
|
||||
|
||||
#include "GrGpuResourceCacheAccess.h"
|
||||
#include "GrInOrderDrawBuffer.h"
|
||||
@ -139,9 +138,7 @@ class GrPipeline;
|
||||
|
||||
class MockGpu : public GrGpu {
|
||||
public:
|
||||
MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(context) {
|
||||
fCaps.reset(SkNEW_ARGS(GrCaps, (options)));
|
||||
}
|
||||
MockGpu(GrContext* context) : INHERITED(context) { fCaps.reset(SkNEW(GrCaps)); }
|
||||
~MockGpu() override {}
|
||||
bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const override {
|
||||
return true;
|
||||
@ -252,16 +249,15 @@ private:
|
||||
};
|
||||
|
||||
GrContext* GrContext::CreateMockContext() {
|
||||
GrContext* context = SkNEW(GrContext);
|
||||
GrContext* context = SkNEW_ARGS(GrContext, (Options()));
|
||||
|
||||
context->initMockContext();
|
||||
return context;
|
||||
}
|
||||
|
||||
void GrContext::initMockContext() {
|
||||
GrContextOptions options;
|
||||
SkASSERT(NULL == fGpu);
|
||||
fGpu = SkNEW_ARGS(MockGpu, (this, options));
|
||||
fGpu = SkNEW_ARGS(MockGpu, (this));
|
||||
SkASSERT(fGpu);
|
||||
this->initCommon();
|
||||
|
||||
|
@ -12,9 +12,7 @@
|
||||
#include "SkTSearch.h"
|
||||
#include "SkTSort.h"
|
||||
|
||||
GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
|
||||
const GrGLContextInfo& ctxInfo,
|
||||
const GrGLInterface* glInterface) : INHERITED(contextOptions) {
|
||||
GrGLCaps::GrGLCaps(const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface) {
|
||||
fVerifiedColorConfigs.reset();
|
||||
fStencilFormats.reset();
|
||||
fStencilVerifiedColorConfigs.reset();
|
||||
|
@ -91,8 +91,7 @@ public:
|
||||
* Initializes the GrGLCaps to the set of features supported in the current
|
||||
* OpenGL context accessible via ctxInfo.
|
||||
*/
|
||||
GrGLCaps(const GrContextOptions& contextOptions, const GrGLContextInfo& ctxInfo,
|
||||
const GrGLInterface* glInterface);
|
||||
GrGLCaps(const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface);
|
||||
|
||||
/**
|
||||
* Call to note that a color config has been verified as a valid color
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContextOptions& options) {
|
||||
GrGLContext* GrGLContext::Create(const GrGLInterface* interface) {
|
||||
// We haven't validated the GrGLInterface yet, so check for GetString function pointer
|
||||
if (!interface->fFunctions.fGetString) {
|
||||
return NULL;
|
||||
@ -55,9 +55,6 @@ GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContext
|
||||
args.fIsMesa = GrGLIsMesaFromVersionString(ver);
|
||||
|
||||
args.fIsChromium = GrGLIsChromiumFromRendererString(renderer);
|
||||
|
||||
args.fContextOptions = &options;
|
||||
|
||||
return SkNEW_ARGS(GrGLContext, (args));
|
||||
}
|
||||
|
||||
@ -70,5 +67,5 @@ GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) {
|
||||
fIsMesa = args.fIsMesa;
|
||||
fIsChromium = args.fIsChromium;
|
||||
|
||||
fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*args.fContextOptions, *this, fInterface)));
|
||||
fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*this, fInterface)));
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "GrGLSL.h"
|
||||
#include "GrGLUtil.h"
|
||||
|
||||
struct GrContextOptions;
|
||||
#include "SkString.h"
|
||||
|
||||
/**
|
||||
* Encapsulates information about an OpenGL context including the OpenGL
|
||||
@ -51,7 +51,6 @@ protected:
|
||||
GrGLRenderer fRenderer;
|
||||
bool fIsMesa;
|
||||
bool fIsChromium;
|
||||
const GrContextOptions* fContextOptions;
|
||||
};
|
||||
|
||||
GrGLContextInfo(const ConstructorArgs& args);
|
||||
@ -75,7 +74,7 @@ public:
|
||||
* Creates a GrGLContext from a GrGLInterface and the currently
|
||||
* bound OpenGL context accessible by the GrGLInterface.
|
||||
*/
|
||||
static GrGLContext* Create(const GrGLInterface* interface, const GrContextOptions& options);
|
||||
static GrGLContext* Create(const GrGLInterface* interface);
|
||||
|
||||
const GrGLInterface* interface() const { return fInterface; }
|
||||
|
||||
|
@ -157,8 +157,7 @@ bool GrGLGpu::BlendCoeffReferencesConstant(GrBlendCoeff coeff) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GrGpu* GrGLGpu::Create(GrBackendContext backendContext, const GrContextOptions& options,
|
||||
GrContext* context) {
|
||||
GrGpu* GrGLGpu::Create(GrBackendContext backendContext, GrContext* context) {
|
||||
SkAutoTUnref<const GrGLInterface> glInterface(
|
||||
reinterpret_cast<const GrGLInterface*>(backendContext));
|
||||
if (!glInterface) {
|
||||
@ -169,7 +168,7 @@ GrGpu* GrGLGpu::Create(GrBackendContext backendContext, const GrContextOptions&
|
||||
if (!glInterface) {
|
||||
return NULL;
|
||||
}
|
||||
GrGLContext* glContext = GrGLContext::Create(glInterface, options);
|
||||
GrGLContext* glContext = GrGLContext::Create(glInterface);
|
||||
if (glContext) {
|
||||
return SkNEW_ARGS(GrGLGpu, (glContext, context));
|
||||
}
|
||||
@ -1437,7 +1436,7 @@ bool GrGLGpu::flushGLState(const DrawArgs& args) {
|
||||
|
||||
fCurrentProgram.reset(fProgramCache->getProgram(args));
|
||||
if (NULL == fCurrentProgram.get()) {
|
||||
GrCapsDebugf(this->caps(), "Failed to create program!\n");
|
||||
GrContextDebugf(this->getContext(), "Failed to create program!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,7 @@ class GrNonInstancedVertices;
|
||||
|
||||
class GrGLGpu : public GrGpu {
|
||||
public:
|
||||
static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions& options,
|
||||
GrContext* context);
|
||||
static GrGpu* Create(GrBackendContext backendContext, GrContext* context);
|
||||
~GrGLGpu() override;
|
||||
|
||||
void contextAbandoned() override;
|
||||
|
@ -261,7 +261,7 @@ void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix
|
||||
#ifdef SK_DEBUG
|
||||
void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
|
||||
if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
|
||||
GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n");
|
||||
GrContextDebugf(fGpu->getContext(), "Unused uniform in shader\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -207,7 +207,7 @@ bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
|
||||
|
||||
totalTextures += processor->numTextures();
|
||||
if (totalTextures >= maxTextureUnits) {
|
||||
GrCapsDebugf(fGpu->caps(), "Program would use too many texture units\n");
|
||||
GrContextDebugf(fGpu->getContext(), "Program would use too many texture units\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ DEF_GPUTEST(GLPrograms, reporter, factory) {
|
||||
#endif
|
||||
|
||||
// We suppress prints to avoid spew
|
||||
GrContextOptions opts;
|
||||
GrContext::Options opts;
|
||||
opts.fSuppressPrints = true;
|
||||
GrContextFactory debugFactory(opts);
|
||||
for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
namespace sk_tools {
|
||||
#if SK_SUPPORT_GPU
|
||||
CopyTilesRenderer::CopyTilesRenderer(const GrContextOptions& opts, int x, int y)
|
||||
CopyTilesRenderer::CopyTilesRenderer(const GrContext::Options& opts, int x, int y)
|
||||
: INHERITED(opts)
|
||||
, fXTilesPerLargeTile(x)
|
||||
, fYTilesPerLargeTile(y) { }
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "PictureRenderer.h"
|
||||
#include "SkTypes.h"
|
||||
|
||||
struct GrContextOptions;
|
||||
class SkPicture;
|
||||
class SkString;
|
||||
|
||||
@ -24,7 +23,7 @@ namespace sk_tools {
|
||||
|
||||
public:
|
||||
#if SK_SUPPORT_GPU
|
||||
CopyTilesRenderer(const GrContextOptions &opts, int x, int y);
|
||||
CopyTilesRenderer(const GrContext::Options &opts, int x, int y);
|
||||
#else
|
||||
CopyTilesRenderer(int x, int y);
|
||||
#endif
|
||||
|
@ -465,7 +465,7 @@ SkString SimplePictureRenderer::getConfigNameInternal() {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
TiledPictureRenderer::TiledPictureRenderer(const GrContextOptions& opts)
|
||||
TiledPictureRenderer::TiledPictureRenderer(const GrContext::Options& opts)
|
||||
: INHERITED(opts)
|
||||
, fTileWidth(kDefaultTileWidth)
|
||||
#else
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include "image_expectations.h"
|
||||
|
||||
struct GrContextOptions;
|
||||
class SkBitmap;
|
||||
class SkCanvas;
|
||||
class SkGLContext;
|
||||
@ -393,7 +392,7 @@ public:
|
||||
return fGrContext;
|
||||
}
|
||||
|
||||
const GrContextOptions& getGrContextOptions() {
|
||||
const GrContext::Options& getGrContextOptions() {
|
||||
return fGrContextFactory.getGlobalOptions();
|
||||
}
|
||||
#endif
|
||||
@ -407,7 +406,7 @@ public:
|
||||
}
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
explicit PictureRenderer(const GrContextOptions &opts)
|
||||
explicit PictureRenderer(const GrContext::Options &opts)
|
||||
#else
|
||||
PictureRenderer()
|
||||
#endif
|
||||
@ -499,7 +498,7 @@ private:
|
||||
class RecordPictureRenderer : public PictureRenderer {
|
||||
public:
|
||||
#if SK_SUPPORT_GPU
|
||||
RecordPictureRenderer(const GrContextOptions &opts) : INHERITED(opts) { }
|
||||
RecordPictureRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
|
||||
#endif
|
||||
|
||||
bool render(SkBitmap** out = NULL) override;
|
||||
@ -520,7 +519,7 @@ private:
|
||||
class PipePictureRenderer : public PictureRenderer {
|
||||
public:
|
||||
#if SK_SUPPORT_GPU
|
||||
PipePictureRenderer(const GrContextOptions &opts) : INHERITED(opts) { }
|
||||
PipePictureRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
|
||||
#endif
|
||||
|
||||
bool render(SkBitmap** out = NULL) override;
|
||||
@ -534,7 +533,7 @@ private:
|
||||
class SimplePictureRenderer : public PictureRenderer {
|
||||
public:
|
||||
#if SK_SUPPORT_GPU
|
||||
SimplePictureRenderer(const GrContextOptions &opts) : INHERITED(opts) { }
|
||||
SimplePictureRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
|
||||
#endif
|
||||
|
||||
virtual void init(const SkPicture* pict,
|
||||
@ -555,7 +554,7 @@ private:
|
||||
class TiledPictureRenderer : public PictureRenderer {
|
||||
public:
|
||||
#if SK_SUPPORT_GPU
|
||||
TiledPictureRenderer(const GrContextOptions &opts);
|
||||
TiledPictureRenderer(const GrContext::Options &opts);
|
||||
#else
|
||||
TiledPictureRenderer();
|
||||
#endif
|
||||
@ -690,7 +689,7 @@ private:
|
||||
class PlaybackCreationRenderer : public PictureRenderer {
|
||||
public:
|
||||
#if SK_SUPPORT_GPU
|
||||
PlaybackCreationRenderer(const GrContextOptions &opts) : INHERITED(opts) { }
|
||||
PlaybackCreationRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
|
||||
#endif
|
||||
|
||||
void setup() override;
|
||||
@ -710,7 +709,7 @@ private:
|
||||
};
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
extern PictureRenderer* CreateGatherPixelRefsRenderer(const GrContextOptions& opts);
|
||||
extern PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts);
|
||||
#else
|
||||
extern PictureRenderer* CreateGatherPixelRefsRenderer();
|
||||
#endif
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "PictureRenderingFlags.h"
|
||||
|
||||
#include "CopyTilesRenderer.h"
|
||||
#include "GrContextOptions.h"
|
||||
#include "PictureRenderer.h"
|
||||
#include "picture_utils.h"
|
||||
#include "SkCommandLineFlags.h"
|
||||
@ -95,7 +94,7 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) {
|
||||
const char* mode = NULL;
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
GrContextOptions grContextOpts;
|
||||
GrContext::Options grContextOpts;
|
||||
grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks;
|
||||
#define RENDERER_ARGS (grContextOpts)
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user