blob: d0f195902a3e63a07c0bae194eb044f0321845c8 [file] [log] [blame]
robertphillips7b9e8a42014-12-11 08:20:31 -08001/*
2 * Copyright 2014 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
8#ifndef SkSurface_Gpu_DEFINED
9#define SkSurface_Gpu_DEFINED
10
11#include "SkSurface_Base.h"
12
13#if SK_SUPPORT_GPU
14
15class SkGpuDevice;
16
17class SkSurface_Gpu : public SkSurface_Base {
18public:
robertphillips24e91282016-04-29 06:46:36 -070019 SkSurface_Gpu(sk_sp<SkGpuDevice>);
robertphillips7b9e8a42014-12-11 08:20:31 -080020 virtual ~SkSurface_Gpu();
21
joshualitt81793412015-07-08 12:54:04 -070022 GrBackendObject onGetTextureHandle(BackendHandleAccess) override;
23 bool onGetRenderTargetHandle(GrBackendObject*, BackendHandleAccess) override;
mtklein36352bf2015-03-25 18:17:31 -070024 SkCanvas* onNewCanvas() override;
reede8f30622016-03-23 18:59:25 -070025 sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override;
26 sk_sp<SkImage> onNewImageSnapshot(SkBudgeted, ForceCopyMode) override;
mtklein36352bf2015-03-25 18:17:31 -070027 void onCopyOnWrite(ContentChangeMode) override;
28 void onDiscard() override;
ericrkf7b8b8a2016-02-24 14:49:51 -080029 void onPrepareForExternalIO() override;
robertphillips7b9e8a42014-12-11 08:20:31 -080030
robertphillips24e91282016-04-29 06:46:36 -070031 SkGpuDevice* getDevice() { return fDevice.get(); }
robertphillips7b9e8a42014-12-11 08:20:31 -080032
33private:
robertphillips24e91282016-04-29 06:46:36 -070034 sk_sp<SkGpuDevice> fDevice;
robertphillips7b9e8a42014-12-11 08:20:31 -080035
36 typedef SkSurface_Base INHERITED;
37};
38
39#endif // SK_SUPPORT_GPU
40
41#endif // SkSurface_Gpu_DEFINED