aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compute/sk/SkSurface_Compute.h
blob: 84836c0f29454fecf58cba76173c2c6d0c664a55 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSurface_Compute_DEFINED
#define SkSurface_Compute_DEFINED

//
// for now make sure it's defined
//

#if !defined(SK_SUPPORT_GPU_COMPUTE)
#define SK_SUPPORT_GPU_COMPUTE 1
#endif

//
//
//

#if SK_SUPPORT_GPU_COMPUTE

//
//
//

#include "SkSurface_Base.h"
#include "GrContext.h"
#include "SkRefCnt.h"

// Yuqian: It doesn't seem right to me for SkSurface_Compute to depend on SkWindow.
//         Maybe we should move MakeComputeBackedSurface(from SkWindow) to SkWindow.cpp.
// #include "SkWindow.h"

//
//
//

#include "SkContext_Compute.h"

//
//
//

//
//
//

class SkSurface_Compute : public SkSurface_Base
{
 public:

  SkSurface_Compute(sk_sp<SkContext_Compute> compute,
                    int const width, int const height);

  ~SkSurface_Compute();

  //
  //
  //

  SkCanvas*         onNewCanvas()                                    override;
  sk_sp<SkSurface>  onNewSurface(const SkImageInfo&)                 override;
  sk_sp<SkImage>    onNewImageSnapshot() override;
  void              onCopyOnWrite(ContentChangeMode)                 override;

  //
  //
  //

  // static sk_sp<SkSurface> MakeComputeBackedSurface(SkWindow                       * const window,
  //                                                  const SkWindow::AttachmentInfo &       attachmentInfo,
  //                                                  GrGLInterface const            * const grInterface,
  //                                                  GrContext                      * const grContext,
  //                                                  sk_sp<SkContext_Compute>               compute);
  // //
  //
  //

 private:

  typedef SkSurface_Base INHERITED;

  //
  //
  //

  sk_sp<SkBaseDevice>      device;

  //
  //
  //

  sk_sp<SkContext_Compute> compute;

  //
  //
  //
};

//
//
//

#endif

//
//
//

#endif