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

Unified Diff: dm/DMSrcSink.cpp

Issue 817573004: turn back on gpu tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: missing file Created 5 years, 11 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
« no previous file with comments | « dm/DMSrcSink.h ('k') | gyp/dm.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 4f272f11f877b493735b48c252f3449fe1b61d1e..f02acf1b87afe69f6c57bdfa03b6158426a74b08 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -6,7 +6,6 @@
#include "SkOSFile.h"
#include "SkPictureRecorder.h"
#include "SkRandom.h"
-#include "SkTLS.h"
namespace DM {
@@ -153,30 +152,23 @@ Name SKPSrc::name() const { return SkOSPath::Basename(fPath.c_str()); }
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-DEFINE_string(gpu_threading, "none",
- "none: single thread,\n"
- "tls: any thread, GrContextFactory in TLS (crashy),\n"
- "stack: any thread, GrContextFactory on stack (less crashy, differently so)");
-
-GPUSink::GPUSink(GrContextFactory::GLContextType ct, GrGLStandard api, int samples, bool dfText)
+GPUSink::GPUSink(GrContextFactory::GLContextType ct,
+ GrGLStandard api,
+ int samples,
+ bool dfText,
+ bool threaded)
: fContextType(ct)
, fGpuAPI(api)
, fSampleCount(samples)
- , fUseDFText(dfText) {}
+ , fUseDFText(dfText)
+ , fThreaded(threaded) {}
int GPUSink::enclave() const {
- return FLAGS_gpu_threading.contains("none") ? kGPUSink_Enclave : kAnyThread_Enclave;
+ return fThreaded ? kAnyThread_Enclave : kGPUSink_Enclave;
}
-static void* CreateGrFactory() { return new GrContextFactory; }
-static void DeleteGrFactory(void* p) { delete (GrContextFactory*)p; }
-
Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*) const {
- GrContextFactory local, *factory = &local;
- if (!FLAGS_gpu_threading.contains("stack")) {
- factory = (GrContextFactory*)SkTLS::Get(CreateGrFactory, DeleteGrFactory);
- }
- // Does abandoning / resetting contexts make any sense if we have stack-scoped factories?
+ GrContextFactory* factory = GetThreadLocalGrContextFactory();
if (FLAGS_abandonGpuContext) {
factory->abandonContexts();
}
« no previous file with comments | « dm/DMSrcSink.h ('k') | gyp/dm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698