diff options
author | Brian Osman <brianosman@google.com> | 2017-08-23 10:12:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-23 14:33:25 +0000 |
commit | 51279987957a64d0f1a9cf7d299a8689734a0e50 (patch) | |
tree | 83d4c96ff5de8598a1025c58ac513f21650a8b99 /src/gpu/GrContext.cpp | |
parent | db816992bb979850853965e0f03565a535204e7d (diff) |
Add an (optional) SkTaskGroup to GrContext
GrContextOptions has an SkExecutor field, allowing clients to supply a
thread pool. If present, the GrContext will create an SkTaskGroup that
can be used for internal threading work.
Bug: skia:
Change-Id: I8b01245515a21a83f9fe838caf0a01c9a26c0003
Reviewed-on: https://skia-review.googlesource.com/37580
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r-- | src/gpu/GrContext.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index d5c82c64da..915700ce82 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -27,6 +27,8 @@ #include "SkConvertPixels.h" #include "SkGr.h" #include "SkJSONWriter.h" +#include "SkMakeUnique.h" +#include "SkTaskGroup.h" #include "SkUnPreMultiplyPriv.h" #include "effects/GrConfigConversionEffect.h" #include "text/GrTextBlobCache.h" @@ -201,6 +203,10 @@ bool GrContext::init(const GrContextOptions& options) { fTextBlobCache.reset(new GrTextBlobCache(TextBlobCacheOverBudgetCB, this)); + if (options.fExecutor) { + fTaskGroup = skstd::make_unique<SkTaskGroup>(*options.fExecutor); + } + return true; } |