blob: dff7970d461af26ff54e58f2f039fe3bef578b2f [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:
bsalomonafe30052015-01-16 07:32:33 -080019 SkSurface_Gpu(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;
25 SkSurface* onNewSurface(const SkImageInfo&) override;
bsalomonf47b9a32016-02-22 11:02:58 -080026 SkImage* onNewImageSnapshot(Budgeted, 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
31 SkGpuDevice* getDevice() { return fDevice; }
32
33private:
34 SkGpuDevice* fDevice;
35
36 typedef SkSurface_Base INHERITED;
37};
38
39#endif // SK_SUPPORT_GPU
40
41#endif // SkSurface_Gpu_DEFINED