blob: 23241540bfe3d95d7f550480204d230f77f14f06 [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;
26 SkImage* onNewImageSnapshot(Budgeted) override;
mtklein36352bf2015-03-25 18:17:31 -070027 void onCopyOnWrite(ContentChangeMode) override;
28 void onDiscard() override;
robertphillips7b9e8a42014-12-11 08:20:31 -080029
30 SkGpuDevice* getDevice() { return fDevice; }
31
32private:
33 SkGpuDevice* fDevice;
34
35 typedef SkSurface_Base INHERITED;
36};
37
38#endif // SK_SUPPORT_GPU
39
40#endif // SkSurface_Gpu_DEFINED