blob: de1fca523386d3b35c507507068bf59073c06e34 [file] [log] [blame]
* Copyright 2016 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#include "SkBBoxHierarchy.h"
#include "SkDrawable.h"
#include "SkRecord.h"
#include "SkRecorder.h"
class SkRecordedDrawable : public SkDrawable {
SkRecordedDrawable(sk_sp<SkRecord> record, sk_sp<SkBBoxHierarchy> bbh,
std::unique_ptr<SkDrawableList> drawableList, const SkRect& bounds)
: fRecord(std::move(record))
, fBBH(std::move(bbh))
, fDrawableList(std::move(drawableList))
, fBounds(bounds)
void flatten(SkWriteBuffer& buffer) const override;
static sk_sp<SkFlattenable> CreateProc(SkReadBuffer& buffer);
Factory getFactory() const override { return CreateProc; }
SkRect onGetBounds() override { return fBounds; }
void onDraw(SkCanvas* canvas) override;
SkPicture* onNewPictureSnapshot() override;
sk_sp<SkRecord> fRecord;
sk_sp<SkBBoxHierarchy> fBBH;
std::unique_ptr<SkDrawableList> fDrawableList;
const SkRect fBounds;