• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 Google LLC
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 skgpu_Surface_Graphite_DEFINED
9 #define skgpu_Surface_Graphite_DEFINED
10 
11 #include "src/image/SkSurface_Base.h"
12 
13 namespace skgpu {
14 
15 class Device;
16 
17 class Surface_Graphite final : public SkSurface_Base {
18 public:
19     Surface_Graphite(sk_sp<Device>);
20     ~Surface_Graphite() override;
21 
22     SkCanvas* onNewCanvas() override;
23     sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override;
24     sk_sp<SkImage> onNewImageSnapshot(const SkIRect* subset) override;
25     void onWritePixels(const SkPixmap&, int x, int y) override;
26     bool onCopyOnWrite(ContentChangeMode) override;
27 
28 private:
29     sk_sp<Device> fDevice;
30 };
31 
32 } // namespace skgpu
33 
34 #endif // skgpu_Surface_Graphite_DEFINED
35