aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2014-11-07 07:12:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-07 07:12:46 -0800
commit4736e1434ae329e3a737dfd9504c22b3fc13dc72 (patch)
tree6655d830ec2999edffdcd08176c092573b2dd225 /dm
parent7376b6a1a1da2fd1c7c56b9d55214854711f9909 (diff)
Get gpudft support working in dm, gm, nanobench and bench_pictures
Adds a new config to test distance field text. Clean up some flags and #defines to read "distance field text", not "distance field fonts" to be consistent with Chromium NOTREECHECKS=true Committed: https://skia.googlesource.com/skia/+/06ba179838ba4fe187cf290750aeeb4a02a2960b Review URL: https://codereview.chromium.org/699453005
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp19
-rw-r--r--dm/DMGpuGMTask.cpp6
-rw-r--r--dm/DMGpuGMTask.h4
-rw-r--r--dm/DMGpuSupport.h10
4 files changed, 24 insertions, 15 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 2a0c636f61..52c86d5f68 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -86,18 +86,19 @@ static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms,
START("565", CpuGMTask, kRGB_565_SkColorType);
START("8888", CpuGMTask, kN32_SkColorType);
- START("gpu", GpuGMTask, native, gpuAPI, 0);
- START("msaa4", GpuGMTask, native, gpuAPI, 4);
- START("msaa16", GpuGMTask, native, gpuAPI, 16);
- START("nvprmsaa4", GpuGMTask, nvpr, gpuAPI, 4);
- START("nvprmsaa16", GpuGMTask, nvpr, gpuAPI, 16);
- START("gpunull", GpuGMTask, null, gpuAPI, 0);
- START("gpudebug", GpuGMTask, debug, gpuAPI, 0);
+ START("gpu", GpuGMTask, native, gpuAPI, 0, false);
+ START("msaa4", GpuGMTask, native, gpuAPI, 4, false);
+ START("msaa16", GpuGMTask, native, gpuAPI, 16, false);
+ START("nvprmsaa4", GpuGMTask, nvpr, gpuAPI, 4, false);
+ START("nvprmsaa16", GpuGMTask, nvpr, gpuAPI, 16, false);
+ START("gpudft", GpuGMTask, native, gpuAPI, 0, true);
+ START("gpunull", GpuGMTask, null, gpuAPI, 0, false);
+ START("gpudebug", GpuGMTask, debug, gpuAPI, 0, false);
#if SK_ANGLE
- START("angle", GpuGMTask, angle, gpuAPI, 0);
+ START("angle", GpuGMTask, angle, gpuAPI, 0, false);
#endif
#if SK_MESA
- START("mesa", GpuGMTask, mesa, gpuAPI, 0);
+ START("mesa", GpuGMTask, mesa, gpuAPI, 0, false);
#endif
START("pdf", PDFTask, RASTERIZE_PDF_PROC);
}
diff --git a/dm/DMGpuGMTask.cpp b/dm/DMGpuGMTask.cpp
index 2890483f55..9347ebdfe9 100644
--- a/dm/DMGpuGMTask.cpp
+++ b/dm/DMGpuGMTask.cpp
@@ -13,13 +13,15 @@ GpuGMTask::GpuGMTask(const char* config,
skiagm::GMRegistry::Factory gmFactory,
GrContextFactory::GLContextType contextType,
GrGLStandard gpuAPI,
- int sampleCount)
+ int sampleCount,
+ bool useDFText)
: GpuTask(reporter, taskRunner)
, fGM(gmFactory(NULL))
, fName(UnderJoin(fGM->getName(), config))
, fContextType(contextType)
, fGpuAPI(gpuAPI)
, fSampleCount(sampleCount)
+ , fUseDFText(useDFText)
{}
static bool gAlreadyWarned[GrContextFactory::kGLContextTypeCnt][kGrGLStandardCnt];
@@ -30,7 +32,7 @@ void GpuGMTask::draw(GrContextFactory* grFactory) {
kN32_SkColorType,
kPremul_SkAlphaType);
SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fGpuAPI, info,
- fSampleCount));
+ fSampleCount, fUseDFText));
if (!surface) {
if (!gAlreadyWarned[fContextType][fGpuAPI]) {
SkDebugf("FYI: couldn't create GPU context, type %d API %d. Will skip.\n",
diff --git a/dm/DMGpuGMTask.h b/dm/DMGpuGMTask.h
index 23f3a45b0c..553436d040 100644
--- a/dm/DMGpuGMTask.h
+++ b/dm/DMGpuGMTask.h
@@ -22,7 +22,8 @@ public:
skiagm::GMRegistry::Factory,
GrContextFactory::GLContextType,
GrGLStandard gpuAPI,
- int sampleCount);
+ int sampleCount,
+ bool useDFText);
virtual void draw(GrContextFactory*) SK_OVERRIDE;
virtual bool shouldSkip() const SK_OVERRIDE;
@@ -34,6 +35,7 @@ private:
const GrContextFactory::GLContextType fContextType;
GrGLStandard fGpuAPI;
const int fSampleCount;
+ const bool fUseDFText;
};
} // namespace DM
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h
index 90b0ea55cf..33d8995b44 100644
--- a/dm/DMGpuSupport.h
+++ b/dm/DMGpuSupport.h
@@ -21,8 +21,11 @@ static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory,
GrContextFactory::GLContextType type,
GrGLStandard gpuAPI,
SkImageInfo info,
- int samples) {
- return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, samples, NULL);
+ int samples,
+ bool useDFText) {
+ uint32_t flags = useDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0;
+ SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
+ return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, samples, &props);
}
} // namespace DM
@@ -62,7 +65,8 @@ static inline SkSurface* NewGpuSurface(GrContextFactory*,
GrContextFactory::GLContextType,
GrGLStandard,
SkImageInfo,
- int) {
+ int,
+ bool) {
return NULL;
}