blob: 9593bbb25bdda68b177e9f8f46a4cd42f15cbe66 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/paint/paint_record.h"
#include "cc/paint/paint_op_buffer.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
namespace cc {
sk_sp<SkPicture> ToSkPicture(sk_sp<PaintRecord> record, const SkRect& bounds) {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(bounds);
record->Playback(canvas);
return recorder.finishRecordingAsPicture();
}
sk_sp<const SkPicture> ToSkPicture(sk_sp<const PaintRecord> record,
const SkRect& bounds) {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(bounds);
record->Playback(canvas);
return recorder.finishRecordingAsPicture();
}
} // namespace cc