2015-03-25 14:11:02 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2014-03-26 21:26:15 +00:00
|
|
|
#ifndef DMGpuSupport_DEFINED
|
|
|
|
#define DMGpuSupport_DEFINED
|
|
|
|
|
|
|
|
// Provides Ganesh to DM,
|
|
|
|
// or if it's not available, fakes it enough so most code doesn't have to know that.
|
|
|
|
|
|
|
|
#include "SkSurface.h"
|
|
|
|
|
2015-12-03 20:58:06 +00:00
|
|
|
// This should be safe to include even in no-gpu builds. Include by relative path so it
|
|
|
|
// can be found in non-gpu builds.
|
|
|
|
#include "../include/gpu/GrContextOptions.h"
|
|
|
|
|
2014-03-26 21:26:15 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
|
|
|
|
// Ganesh is available. Yippee!
|
|
|
|
|
|
|
|
# include "GrContext.h"
|
|
|
|
# include "GrContextFactory.h"
|
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
|
|
|
static const bool kGPUDisabled = false;
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#else// !SK_SUPPORT_GPU
|
|
|
|
|
|
|
|
// Ganesh is not available. Fake it.
|
|
|
|
|
2014-06-30 13:36:31 +00:00
|
|
|
enum GrGLStandard {
|
|
|
|
kNone_GrGLStandard,
|
|
|
|
kGL_GrGLStandard,
|
|
|
|
kGLES_GrGLStandard
|
|
|
|
};
|
2014-11-06 16:06:39 +00:00
|
|
|
static const int kGrGLStandardCnt = 3;
|
2014-06-30 13:36:31 +00:00
|
|
|
|
2015-02-03 02:26:03 +00:00
|
|
|
class GrContext {
|
|
|
|
public:
|
|
|
|
void dumpCacheStats(SkString*) const {}
|
|
|
|
void dumpGpuStats(SkString*) const {}
|
|
|
|
};
|
|
|
|
|
2018-03-09 14:01:53 +00:00
|
|
|
class SkCommandLineConfigGpu {
|
|
|
|
public:
|
|
|
|
enum class SurfType;
|
|
|
|
};
|
|
|
|
|
2016-03-31 01:56:19 +00:00
|
|
|
namespace sk_gpu_test {
|
2014-03-26 21:26:15 +00:00
|
|
|
class GrContextFactory {
|
|
|
|
public:
|
2017-02-21 19:36:05 +00:00
|
|
|
GrContextFactory() {}
|
2015-05-27 20:23:23 +00:00
|
|
|
explicit GrContextFactory(const GrContextOptions&) {}
|
|
|
|
|
2016-04-05 18:06:27 +00:00
|
|
|
typedef int ContextType;
|
|
|
|
|
|
|
|
static const ContextType kANGLE_ContextType = 0,
|
|
|
|
kANGLE_GL_ContextType = 0,
|
|
|
|
kCommandBuffer_ContextType = 0,
|
|
|
|
kDebugGL_ContextType = 0,
|
|
|
|
kNVPR_ContextType = 0,
|
|
|
|
kNativeGL_ContextType = 0,
|
|
|
|
kGL_ContextType = 0,
|
|
|
|
kGLES_ContextType = 0,
|
2016-04-11 21:21:33 +00:00
|
|
|
kNullGL_ContextType = 0,
|
2017-07-13 19:34:56 +00:00
|
|
|
kVulkan_ContextType = 0,
|
|
|
|
kMetal_ContextType = 0;
|
2016-04-05 18:06:27 +00:00
|
|
|
static const int kContextTypeCnt = 1;
|
2017-02-21 19:36:05 +00:00
|
|
|
enum class ContextOverrides {};
|
2014-07-15 15:27:06 +00:00
|
|
|
void destroyContexts() {}
|
2014-07-28 20:48:36 +00:00
|
|
|
|
|
|
|
void abandonContexts() {}
|
2016-04-01 18:54:31 +00:00
|
|
|
|
|
|
|
void releaseResourcesAndAbandonContexts() {}
|
2014-03-26 21:26:15 +00:00
|
|
|
};
|
2016-03-31 01:56:19 +00:00
|
|
|
} // namespace sk_gpu_test
|
2014-03-26 21:26:15 +00:00
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
|
|
|
static const bool kGPUDisabled = true;
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#endif//SK_SUPPORT_GPU
|
|
|
|
|
|
|
|
#endif//DMGpuSupport_DEFINED
|