aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Gpu.h
blob: 72e9caf4629e27c0486c4a0818fc625935bdaa92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * 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(SkGpuDevice*);
    virtual ~SkSurface_Gpu();

    GrBackendObject onGetTextureHandle(BackendHandleAccess) override;
    bool onGetRenderTargetHandle(GrBackendObject*, BackendHandleAccess) override;
    SkCanvas* onNewCanvas() override;
    SkSurface* onNewSurface(const SkImageInfo&) override;
    SkImage* onNewImageSnapshot(SkBudgeted, ForceCopyMode) override;
    void onCopyOnWrite(ContentChangeMode) override;
    void onDiscard() override;
    void onPrepareForExternalIO() override;

    SkGpuDevice* getDevice() { return fDevice; }

private:
    SkGpuDevice* fDevice;

    typedef SkSurface_Base INHERITED;
};

#endif // SK_SUPPORT_GPU

#endif // SkSurface_Gpu_DEFINED