2017-08-30 16:06:35 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkDeferredDisplayList_DEFINED
|
|
|
|
#define SkDeferredDisplayList_DEFINED
|
|
|
|
|
|
|
|
#include "SkSurfaceCharacterization.h"
|
|
|
|
|
2017-11-30 13:46:03 +00:00
|
|
|
class SkImage; // TODO: rm this since it is just for the temporary placeholder implementation
|
|
|
|
class SkSurface;
|
2017-08-30 16:06:35 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This class contains pre-processed gpu operations that can be replayed into
|
|
|
|
* an SkSurface via draw(SkDeferredDisplayList*).
|
|
|
|
*
|
|
|
|
* TODO: we probably need to expose this class so users can query it for memory usage.
|
|
|
|
*/
|
|
|
|
class SkDeferredDisplayList {
|
|
|
|
public:
|
|
|
|
SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
|
|
|
|
sk_sp<SkImage> image) // TODO rm this parameter
|
|
|
|
: fCharacterization(characterization)
|
|
|
|
, fImage(std::move(image)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
const SkSurfaceCharacterization& characterization() const {
|
|
|
|
return fCharacterization;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: remove this. It is just scaffolding to get something up & running
|
2017-12-04 17:52:46 +00:00
|
|
|
bool draw(SkSurface*);
|
2017-08-30 16:06:35 +00:00
|
|
|
|
|
|
|
private:
|
2017-11-30 16:22:14 +00:00
|
|
|
const SkSurfaceCharacterization fCharacterization;
|
2017-08-30 16:06:35 +00:00
|
|
|
|
|
|
|
// TODO: actually store the GPU opLists
|
|
|
|
sk_sp<SkImage> fImage;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|