Flutter Engine
The Flutter Engine
DrawableOp.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
16
17namespace skgpu::ganesh {
18
20 std::unique_ptr<SkDrawable::GpuDrawHandler> drawable,
21 const SkRect& bounds) {
22 return GrOp::Make<DrawableOp>(context, std::move(drawable), bounds);
23}
24
25DrawableOp::DrawableOp(std::unique_ptr<SkDrawable::GpuDrawHandler> drawable,
26 const SkRect& bounds)
27 : GrOp(ClassID())
28 , fDrawable(std::move(drawable)) {
30}
31
32void DrawableOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
33 SkASSERT(state->opsRenderPass());
34 state->opsRenderPass()->executeDrawable(std::move(fDrawable));
35}
36
37} // namespace skgpu::ganesh
#define SkASSERT(cond)
Definition: SkAssert.h:116
Definition: GrOp.h:70
std::unique_ptr< GrOp > Owner
Definition: GrOp.h:72
const SkRect & bounds() const
Definition: GrOp.h:122
void setBounds(const SkRect &newBounds, HasAABloat aabloat, IsHairline zeroArea)
Definition: GrOp.h:279
static DEFINE_OP_CLASS_ID GrOp::Owner Make(GrRecordingContext *, std::unique_ptr< SkDrawable::GpuDrawHandler > drawable, const SkRect &bounds)
Definition: DrawableOp.cpp:19
AtkStateType state
Optional< SkRect > bounds
Definition: SkRecords.h:189
Definition: ref_ptr.h:256