24e9128694
Split off of https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1925803004 Review-Url: https://codereview.chromium.org/1925803004
42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
/*
|
|
* Copyright 2014 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkSurface_Gpu_DEFINED
|
|
#define SkSurface_Gpu_DEFINED
|
|
|
|
#include "SkSurface_Base.h"
|
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
class SkGpuDevice;
|
|
|
|
class SkSurface_Gpu : public SkSurface_Base {
|
|
public:
|
|
SkSurface_Gpu(sk_sp<SkGpuDevice>);
|
|
virtual ~SkSurface_Gpu();
|
|
|
|
GrBackendObject onGetTextureHandle(BackendHandleAccess) override;
|
|
bool onGetRenderTargetHandle(GrBackendObject*, BackendHandleAccess) override;
|
|
SkCanvas* onNewCanvas() override;
|
|
sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override;
|
|
sk_sp<SkImage> onNewImageSnapshot(SkBudgeted, ForceCopyMode) override;
|
|
void onCopyOnWrite(ContentChangeMode) override;
|
|
void onDiscard() override;
|
|
void onPrepareForExternalIO() override;
|
|
|
|
SkGpuDevice* getDevice() { return fDevice.get(); }
|
|
|
|
private:
|
|
sk_sp<SkGpuDevice> fDevice;
|
|
|
|
typedef SkSurface_Base INHERITED;
|
|
};
|
|
|
|
#endif // SK_SUPPORT_GPU
|
|
|
|
#endif // SkSurface_Gpu_DEFINED
|