/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkRecordedDrawable_DEFINED #define SkRecordedDrawable_DEFINED #include "include/core/SkDrawable.h" #include "src/core/SkBBoxHierarchy.h" #include "src/core/SkRecord.h" #include "src/core/SkRecorder.h" class SkRecordedDrawable : public SkDrawable { public: SkRecordedDrawable(sk_sp record, sk_sp bbh, std::unique_ptr drawableList, const SkRect& bounds) : fRecord(std::move(record)) , fBBH(std::move(bbh)) , fDrawableList(std::move(drawableList)) , fBounds(bounds) {} void flatten(SkWriteBuffer& buffer) const override; protected: SkRect onGetBounds() override { return fBounds; } void onDraw(SkCanvas* canvas) override; SkPicture* onNewPictureSnapshot() override; private: SK_FLATTENABLE_HOOKS(SkRecordedDrawable) sk_sp fRecord; sk_sp fBBH; std::unique_ptr fDrawableList; const SkRect fBounds; }; #endif // SkRecordedDrawable_DEFINED