Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrTextureProxyPriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 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 GrTextureProxyPriv_DEFINED
9#define GrTextureProxyPriv_DEFINED
10
12
14class GrOpFlushState;
15
16/**
17 * This class hides the more specialized capabilities of GrTextureProxy.
18 */
20public:
21 // Attach a deferred uploader to the proxy. Holds data being prepared by a worker thread.
22 void setDeferredUploader(std::unique_ptr<GrDeferredProxyUploader>);
23 bool isDeferred() const { return SkToBool(fTextureProxy->fDeferredUploader.get()); }
24 // For a deferred proxy (one that has a deferred uploader attached), this schedules an ASAP
25 // upload of that data to the instantiated texture.
27 // Clears any deferred uploader object on the proxy. Used to free the CPU data after the
28 // contents have been uploaded.
30
31private:
32 explicit GrTextureProxyPriv(GrTextureProxy* textureProxy) : fTextureProxy(textureProxy) {}
33 GrTextureProxyPriv& operator=(const GrTextureProxyPriv&) = delete;
34
35 // No taking addresses of this type.
36 const GrTextureProxyPriv* operator&() const;
37 GrTextureProxyPriv* operator&();
38
39 GrTextureProxy* fTextureProxy;
40
41 friend class GrTextureProxy; // to construct/copy this type.
42};
43
45
46inline const GrTextureProxyPriv GrTextureProxy::texPriv() const { // NOLINT(readability-const-return-type)
47 return GrTextureProxyPriv(const_cast<GrTextureProxy*>(this));
48}
49
50#endif
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
void setDeferredUploader(std::unique_ptr< GrDeferredProxyUploader >)
void scheduleUpload(GrOpFlushState *)
friend class GrTextureProxyPriv
GrTextureProxyPriv texPriv()