Add a system property to control Skia reduceOpsTaskSplitting

We are testing this flag with a subset of devices in dogfood and
need to have this plumbing available.

Bug: 183612348
Change-Id: I8041053ff3da94b08cd6793fac3ff282bc73da9a
This commit is contained in:
Adlai Holler
2021-03-24 13:26:56 -04:00
parent d19254d3ab
commit dfc7d4cc7b
2 changed files with 12 additions and 0 deletions

View File

@@ -40,6 +40,7 @@
#include <utils/Mutex.h>
#include <thread>
#include <android-base/properties.h>
#include <ui/FatVector.h>
namespace android {
@@ -251,6 +252,11 @@ void RenderThread::requireVkContext() {
void RenderThread::initGrContextOptions(GrContextOptions& options) {
options.fPreferExternalImagesOverES3 = true;
options.fDisableDistanceFieldPaths = true;
if (android::base::GetBoolProperty(PROPERTY_REDUCE_OPS_TASK_SPLITTING, false)) {
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kYes;
} else {
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
}
}
void RenderThread::destroyRenderingContext() {

View File

@@ -38,6 +38,12 @@
#include "thread/ThreadBase.h"
#include "utils/TimeUtils.h"
/**
* (Bool) Turns on the Skia GPU option "reduceOpsTaskSplitting" which improves GPU
* efficiency but may increase VRAM consumption. Default is false.
*/
#define PROPERTY_REDUCE_OPS_TASK_SPLITTING "renderthread.skia.reduceopstasksplitting"
namespace android {
class Bitmap;