blob: 6c0debeb42ae9ccb452a9678f6b36e2c75c37ae5 [file] [log] [blame]
* Copyright 2018 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef GrDrawableOp_DEFINED
#define GrDrawableOp_DEFINED
#include "src/gpu/ops/GrOp.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkMatrix.h"
#include "src/gpu/GrSemaphore.h"
class GrRecordingContext;
class GrDrawableOp final : public GrOp {
static std::unique_ptr<GrDrawableOp> Make(GrRecordingContext*,
std::unique_ptr<SkDrawable::GpuDrawHandler> drawable,
const SkRect& bounds);
const char* name() const override { return "Drawable"; }
#ifdef SK_DEBUG
SkString dumpInfo() const override {
return INHERITED::dumpInfo();
friend class GrOpMemoryPool; // for ctor
GrDrawableOp(std::unique_ptr<SkDrawable::GpuDrawHandler>, const SkRect& bounds);
CombineResult onCombineIfPossible(GrOp* that, GrRecordingContext::Arenas*,
const GrCaps& caps) override {
return CombineResult::kCannotCombine;
void onPrePrepare(GrRecordingContext*,
const GrSurfaceProxyView* writeView,
const GrXferProcessor::DstProxyView&) override {}
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
std::unique_ptr<SkDrawable::GpuDrawHandler> fDrawable;
typedef GrOp INHERITED;