ad8a43f769
Chrome would like to perform cpu-side preprocessing for gpu draws in parallel. They do not want to go through a picture (since they have their own display list format). The general idea is that we add a new SkDeferredDisplayListRecorder class to perform all of Ganesh's cpu-side preprocessing ahead of time and in parallel. The SkDDLRecorder operates like SkPictureRecorder. The user can get an SkCanvas from the SkDDLRecorder and feed it draw operations. Once finished, the user calls 'detach' to get an SkDeferredDisplayList. All the work up to and including the 'detach' call can be done in parallel and will not touch the GPU. To actually get pixels the client must call SkSurface::draw(SkDDL) on an SkSurface that is "compatible" with the surface characterization initially given to the SkDDLMaker. The surface characterization contains the minimum amount of information Ganesh needs to know about the ultimate destination in order to perform its cpu-side work (i.e., caps, width, height, config). Change-Id: I75faa483ab5a6b779c8de56ea56b9d90b990f43a Reviewed-on: https://skia-review.googlesource.com/30140 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
58 lines
1.6 KiB
C
58 lines
1.6 KiB
C
/*
|
|
* Copyright 2014 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SK_COMMON_FLAGS_H
|
|
#define SK_COMMON_FLAGS_H
|
|
|
|
#include "../private/SkTArray.h"
|
|
#include "SkCommandLineFlags.h"
|
|
#include "SkString.h"
|
|
|
|
DECLARE_bool(cpu);
|
|
DECLARE_bool(dryRun);
|
|
DECLARE_bool(gpu);
|
|
DECLARE_string(images);
|
|
DECLARE_string(colorImages);
|
|
DECLARE_bool(simpleCodec);
|
|
DECLARE_string(match);
|
|
DECLARE_bool(quiet);
|
|
DECLARE_bool(resetGpuContext);
|
|
DECLARE_bool(preAbandonGpuContext);
|
|
DECLARE_bool(abandonGpuContext);
|
|
DECLARE_bool(releaseAndAbandonGpuContext);
|
|
DECLARE_string(skps);
|
|
DECLARE_bool(ddl);
|
|
DECLARE_string(svgs);
|
|
DECLARE_int32(threads);
|
|
DECLARE_string(resourcePath);
|
|
DECLARE_bool(verbose);
|
|
DECLARE_bool(veryVerbose);
|
|
DECLARE_string(writePath);
|
|
DECLARE_bool(pre_log);
|
|
DECLARE_bool(analyticAA);
|
|
DECLARE_bool(forceAnalyticAA);
|
|
DECLARE_bool(deltaAA);
|
|
DECLARE_bool(forceDeltaAA);
|
|
|
|
DECLARE_string(key);
|
|
DECLARE_string(properties);
|
|
|
|
/**
|
|
* Helper to assist in collecting image paths from |dir| specified through a command line flag.
|
|
*
|
|
* Populates |output|, an array of strings with paths to images to test.
|
|
*
|
|
* Returns true if each argument to the images flag is meaningful:
|
|
* - If the file/directory does not exist, return false.
|
|
* - If |dir| does not have any supported images (based on file type), return false.
|
|
* - If |dir| is a single file, assume the user is deliberately testing this image,
|
|
* regardless of file type.
|
|
*/
|
|
bool CollectImages(SkCommandLineFlags::StringArray dir, SkTArray<SkString>* output);
|
|
|
|
#endif
|