Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
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
11
#include "
src/gpu/ganesh/GrTextureProxy.h
"
12
13
class
GrDeferredProxyUploader
;
14
class
GrOpFlushState
;
15
16
/**
17
* This class hides the more specialized capabilities of GrTextureProxy.
18
*/
19
class
GrTextureProxyPriv
{
20
public
:
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.
26
void
scheduleUpload
(
GrOpFlushState
*);
27
// Clears any deferred uploader object on the proxy. Used to free the CPU data after the
28
// contents have been uploaded.
29
void
resetDeferredUploader
();
30
31
private
:
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
44
inline
GrTextureProxyPriv
GrTextureProxy::texPriv
() {
return
GrTextureProxyPriv
(
this
); }
45
46
inline
const
GrTextureProxyPriv
GrTextureProxy::texPriv
()
const
{
// NOLINT(readability-const-return-type)
47
return
GrTextureProxyPriv
(
const_cast<
GrTextureProxy
*
>
(
this
));
48
}
49
50
#endif
GrTextureProxy.h
SkToBool
static constexpr bool SkToBool(const T &x)
Definition:
SkTo.h:35
GrDeferredProxyUploader
Definition:
GrDeferredProxyUploader.h:40
GrOpFlushState
Definition:
GrOpFlushState.h:58
GrTextureProxyPriv
Definition:
GrTextureProxyPriv.h:19
GrTextureProxyPriv::setDeferredUploader
void setDeferredUploader(std::unique_ptr< GrDeferredProxyUploader >)
Definition:
GrTextureProxy.cpp:149
GrTextureProxyPriv::scheduleUpload
void scheduleUpload(GrOpFlushState *)
Definition:
GrTextureProxy.cpp:154
GrTextureProxyPriv::resetDeferredUploader
void resetDeferredUploader()
Definition:
GrTextureProxy.cpp:161
GrTextureProxyPriv::isDeferred
bool isDeferred() const
Definition:
GrTextureProxyPriv.h:23
GrTextureProxy
Definition:
GrTextureProxy.h:34
GrTextureProxy::GrTextureProxyPriv
friend class GrTextureProxyPriv
Definition:
GrTextureProxy.h:120
GrTextureProxy::texPriv
GrTextureProxyPriv texPriv()
Definition:
GrTextureProxyPriv.h:44
Generated on Sun Jun 23 2024 21:56:21 for Flutter Engine by
1.9.4