Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
include
private
gpu
ganesh
GrImageContext.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019 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 GrImageContext_DEFINED
9
#define GrImageContext_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/private/base/SingleOwner.h
"
13
#include "
include/private/base/SkAPI.h
"
14
#include "
include/private/gpu/ganesh/GrContext_Base.h
"
15
16
class
GrContextThreadSafeProxy
;
17
class
GrImageContextPriv
;
18
19
// This is now just a view on a ThreadSafeProxy, that SkImages can attempt to
20
// downcast to a GrDirectContext as a backdoor to some operations. Once we remove the backdoors,
21
// this goes away and SkImages just hold ThreadSafeProxies.
22
class
GrImageContext
:
public
GrContext_Base
{
23
public
:
24
~GrImageContext
()
override
;
25
26
// Provides access to functions that aren't part of the public API.
27
GrImageContextPriv
priv
();
28
const
GrImageContextPriv
priv
()
const
;
// NOLINT(readability-const-return-type)
29
30
protected
:
31
friend
class
GrImageContextPriv
;
// for hidden functions
32
33
GrImageContext
(
sk_sp<GrContextThreadSafeProxy>
);
34
35
SK_API
virtual
void
abandonContext
();
36
SK_API
virtual
bool
abandoned
();
37
38
/** This is only useful for debug purposes */
39
skgpu::SingleOwner
*
singleOwner
()
const
{
return
&fSingleOwner; }
40
41
GrImageContext
*
asImageContext
()
override
{
return
this
; }
42
43
private
:
44
// When making promise images, we currently need a placeholder GrImageContext instance to give
45
// to the SkImage that has no real power, just a wrapper around the ThreadSafeProxy.
46
// TODO: De-power SkImage to ThreadSafeProxy or at least figure out a way to share one instance.
47
static
sk_sp<GrImageContext>
MakeForPromiseImage(
sk_sp<GrContextThreadSafeProxy>
);
48
49
// In debug builds we guard against improper thread handling
50
// This guard is passed to the GrDrawingManager and, from there to all the
51
// GrSurfaceDrawContexts. It is also passed to the GrResourceProvider and SkGpuDevice.
52
// TODO: Move this down to GrRecordingContext.
53
mutable
skgpu::SingleOwner
fSingleOwner;
54
};
55
56
#endif
GrContext_Base.h
SingleOwner.h
SkAPI.h
SK_API
#define SK_API
Definition
SkAPI.h:35
SkRefCnt.h
GrContextThreadSafeProxy
Definition
GrContextThreadSafeProxy.h:34
GrContext_Base
Definition
GrContext_Base.h:28
GrImageContextPriv
Definition
GrImageContextPriv.h:19
GrImageContext
Definition
GrImageContext.h:22
GrImageContext::priv
GrImageContextPriv priv()
Definition
GrImageContextPriv.h:49
GrImageContext::singleOwner
skgpu::SingleOwner * singleOwner() const
Definition
GrImageContext.h:39
GrImageContext::~GrImageContext
~GrImageContext() override
Definition
GrImageContext.cpp:19
GrImageContext::abandonContext
virtual SK_API void abandonContext()
Definition
GrImageContext.cpp:21
GrImageContext::abandoned
virtual SK_API bool abandoned()
Definition
GrImageContext.cpp:25
GrImageContext::asImageContext
GrImageContext * asImageContext() override
Definition
GrImageContext.h:41
sk_sp
Definition
SkRefCnt.h:220
skgpu::SingleOwner
Definition
SingleOwner.h:70
Generated on Fri Apr 26 2024 06:16:14 for Flutter Engine by
1.9.8