Flutter Engine
The Flutter Engine
Functions | Variables
CacheBudgetTest.cpp File Reference
#include "tests/Test.h"
#include "include/gpu/graphite/Context.h"
#include "include/gpu/graphite/ContextOptions.h"
#include "include/gpu/graphite/Recorder.h"

Go to the source code of this file.

Functions

static void set_context_budget (skgpu::graphite::ContextOptions *options)
 
 DEF_CONDITIONAL_GRAPHITE_TEST_FOR_CONTEXTS (CacheBudgetTest, nullptr, reporter, context, testContext, set_context_budget, true, CtsEnforcement::kNextRelease)
 

Variables

static constexpr size_t kContextBudget = 1234567
 

Function Documentation

◆ DEF_CONDITIONAL_GRAPHITE_TEST_FOR_CONTEXTS()

DEF_CONDITIONAL_GRAPHITE_TEST_FOR_CONTEXTS ( CacheBudgetTest  ,
nullptr  ,
reporter  ,
context  ,
testContext  ,
set_context_budget  ,
true  ,
CtsEnforcement::kNextRelease   
)

Definition at line 20 of file CacheBudgetTest.cpp.

27 {
28 REPORTER_ASSERT(reporter, context->maxBudgetedBytes() == kContextBudget);
29
30 static constexpr size_t kRecorderBudget = 7654321;
32 recorderOptions.fGpuBudgetInBytes = kRecorderBudget;
33
34 auto recorder = context->makeRecorder(recorderOptions);
35 if (!recorder) {
36 ERRORF(reporter, "Could not create recorder.");
37 return;
38 }
39
40 REPORTER_ASSERT(reporter, recorder->maxBudgetedBytes() == kRecorderBudget);
41}
static constexpr size_t kContextBudget
reporter
Definition: FontMgrTest.cpp:39
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
#define ERRORF(r,...)
Definition: Test.h:293

◆ set_context_budget()

static void set_context_budget ( skgpu::graphite::ContextOptions options)
static

Definition at line 16 of file CacheBudgetTest.cpp.

16 {
17 options->fGpuBudgetInBytes = kContextBudget;
18}
const char * options

Variable Documentation

◆ kContextBudget

constexpr size_t kContextBudget = 1234567
staticconstexpr

Definition at line 14 of file CacheBudgetTest.cpp.