Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Unified Diff: dm/DMBenchTask.cpp

Issue 319043005: Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dm/DMBenchTask.cpp
diff --git a/dm/DMBenchTask.cpp b/dm/DMBenchTask.cpp
index 917e8612743c95f00cfe8e2188c8997a3c22f1ef..3b5e6d282987a46f71901f66cc4e114996b184a9 100644
--- a/dm/DMBenchTask.cpp
+++ b/dm/DMBenchTask.cpp
@@ -33,11 +33,13 @@ GpuBenchTask::GpuBenchTask(const char* config,
TaskRunner* tasks,
BenchRegistry::Factory factory,
GrContextFactory::GLContextType contextType,
+ GrGLStandard forcedGpuApi,
int sampleCount)
: GpuTask(reporter, tasks)
, fBench(factory(NULL))
, fName(bench_name(fBench->getName(), config))
, fContextType(contextType)
+ , fForcedGpuApi(forcedGpuApi)
, fSampleCount(sampleCount) {}
bool NonRenderingBenchTask::shouldSkip() const {
@@ -75,8 +77,12 @@ void GpuBenchTask::draw(GrContextFactory* grFactory) {
fBench->getSize().y(),
kN32_SkColorType,
kPremul_SkAlphaType);
- SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, info, fSampleCount));
-
+ SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fForcedGpuApi, info,
+ fSampleCount));
+ if (!surface) {
+ this->fail("Could not create context for the config and the api.");
+ return;
+ }
fBench->preDraw();
fBench->draw(1, surface->getCanvas());
fBench->postDraw();

Powered by Google App Engine
This is Rietveld 408576698