ef57b7e653
The main meat of things is in SkThreadPool. We can now give SkThreadPool a type for each thread to create and destroy on its local stack. It's TLS without going through SkTLS. I've split the DM tasks into CpuTasks that run on threads with no TLS, and GpuTasks that run on threads with a thread local GrContextFactory. The old CpuTask and GpuTask have been renamed to CpuGMTask and GpuGMTask. Upshot: default run of out/Debug/dm goes from ~45 seconds to ~20 seconds. BUG=skia: R=bsalomon@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/179233005 git-svn-id: http://skia.googlecode.com/svn/trunk@13632 2bbb7eff-a529-9590-31e7-b0007b416f81
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#ifndef DMPipeTask_DEFINED
|
|
#define DMPipeTask_DEFINED
|
|
|
|
#include "DMTask.h"
|
|
#include "SkBitmap.h"
|
|
#include "SkString.h"
|
|
#include "SkTemplates.h"
|
|
#include "gm.h"
|
|
|
|
// Sends a GM through a pipe, draws it, and compares against the reference bitmap.
|
|
|
|
namespace DM {
|
|
|
|
class PipeTask : public CpuTask {
|
|
|
|
public:
|
|
PipeTask(const Task& parent, // PipeTask must be a child task. Pass its parent here.
|
|
skiagm::GM*, // GM to run through a pipe. Takes ownership.
|
|
SkBitmap reference, // Bitmap to compare pipe results to.
|
|
bool crossProcess, // Should we set up a cross process pipe?
|
|
bool sharedAddressSpace); // If cross process, should it assume shared address space?
|
|
|
|
virtual void draw() SK_OVERRIDE;
|
|
virtual bool shouldSkip() const SK_OVERRIDE;
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
private:
|
|
const uint32_t fFlags;
|
|
const SkString fName;
|
|
SkAutoTDelete<skiagm::GM> fGM;
|
|
const SkBitmap fReference;
|
|
};
|
|
|
|
} // namespace DM
|
|
|
|
#endif // DMPipeTask_DEFINED
|