Flutter Engine
The Flutter Engine
|
#include <TestContext.h>
Public Member Functions | |
virtual | ~TestContext () |
bool | fenceSyncSupport () const |
bool | gpuTimingSupport () const |
GpuTimer * | gpuTimer () const |
bool | getMaxGpuFrameLag (int *maxFrameLag) const |
void | makeNotCurrent () const |
void | makeCurrent () const |
SkScopeExit | makeCurrentAndAutoRestore () const |
virtual GrBackendApi | backend ()=0 |
virtual sk_sp< GrDirectContext > | makeContext (const GrContextOptions &) |
void | flushAndWaitOnSync (GrDirectContext *context) |
virtual void | testAbandon () |
void | flushAndSyncCpu (GrDirectContext *) |
Public Member Functions inherited from SkNoncopyable | |
SkNoncopyable ()=default | |
SkNoncopyable (SkNoncopyable &&)=default | |
SkNoncopyable & | operator= (SkNoncopyable &&)=default |
Protected Member Functions | |
TestContext () | |
virtual void | teardown () |
virtual void | onPlatformMakeNotCurrent () const =0 |
virtual void | onPlatformMakeCurrent () const =0 |
virtual std::function< void()> | onPlatformGetAutoContextRestore () const =0 |
Protected Attributes | |
bool | fFenceSupport = false |
std::unique_ptr< GpuTimer > | fGpuTimer |
An offscreen 3D context. This class is intended for Skia's internal testing needs and not for general use.
Definition at line 31 of file TestContext.h.
|
virtual |
Definition at line 19 of file TestContext.cpp.
|
protected |
Definition at line 17 of file TestContext.cpp.
|
pure virtual |
Implemented in sk_gpu_test::GLTestContext.
|
inline |
Definition at line 35 of file TestContext.h.
void sk_gpu_test::TestContext::flushAndSyncCpu | ( | GrDirectContext * | context | ) |
Flush and wait until all GPU work is finished.
Definition at line 61 of file TestContext.cpp.
void sk_gpu_test::TestContext::flushAndWaitOnSync | ( | GrDirectContext * | context | ) |
This will flush work to the GPU. Additionally, if the platform supports fence syncs, we will add a finished callback to our flush call. We allow ourselves to have kMaxFrameLag number of unfinished flushes active on the GPU at a time. If we have 2 outstanding flushes then we will wait on the CPU until one has finished.
Definition at line 37 of file TestContext.cpp.
|
inline |
Definition at line 40 of file TestContext.h.
|
inline |
Definition at line 38 of file TestContext.h.
|
inline |
Definition at line 37 of file TestContext.h.
|
virtual |
Reimplemented in sk_gpu_test::GLTestContext.
Definition at line 24 of file TestContext.cpp.
void sk_gpu_test::TestContext::makeCurrent | ( | ) | const |
Definition at line 29 of file TestContext.cpp.
SkScopeExit sk_gpu_test::TestContext::makeCurrentAndAutoRestore | ( | ) | const |
Like makeCurrent() but this returns an object that will restore the previous current context in its destructor. Useful to undo the effect making this current before returning to a caller that doesn't expect the current context to be changed underneath it.
The returned object restores the current context of the same type (e.g. egl, glx, ...) in its destructor. It is undefined behavior if that context is destroyed before the destructor executes. If the concept of a current context doesn't make sense for this context type then the returned object's destructor is a no-op.
Definition at line 31 of file TestContext.cpp.
void sk_gpu_test::TestContext::makeNotCurrent | ( | ) | const |
Definition at line 28 of file TestContext.cpp.
|
protectedpure virtual |
Subclasses should implement such that the returned function will cause the current context of this type to be made current again when it is called. It should additionally be the case that if "this" is already current when this is called, then "this" is destroyed (thereby setting the null context as current), and then the std::function is called the null context should remain current.
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedvirtual |
This should destroy the 3D context.
Reimplemented in sk_gpu_test::GLTestContext.
Definition at line 70 of file TestContext.cpp.
|
virtual |
This notifies the context that we are deliberately testing abandoning the context. It is useful for debugging contexts that would otherwise test that GPU resources are properly deleted. It also allows a debugging context to test that further API calls are not made by Skia GPU code.
Reimplemented in sk_gpu_test::GLTestContext.
Definition at line 67 of file TestContext.cpp.
|
protected |
Definition at line 87 of file TestContext.h.
|
protected |
Definition at line 89 of file TestContext.h.