Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
tests
graphite
CacheBudgetTest.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2024 Google LLC
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
#include "
tests/Test.h
"
9
10
#include "
include/gpu/graphite/Context.h
"
11
#include "
include/gpu/graphite/ContextOptions.h
"
12
#include "
include/gpu/graphite/Recorder.h
"
13
14
static
constexpr
size_t
kContextBudget
= 1234567;
15
16
static
void
set_context_budget
(
skgpu::graphite::ContextOptions
*
options
) {
17
options
->fGpuBudgetInBytes =
kContextBudget
;
18
}
19
20
DEF_CONDITIONAL_GRAPHITE_TEST_FOR_CONTEXTS
(CacheBudgetTest,
21
nullptr
,
22
reporter
,
23
context,
24
testContext,
25
set_context_budget
,
26
true
,
27
CtsEnforcement::kNextRelease
) {
28
REPORTER_ASSERT
(
reporter
, context->maxBudgetedBytes() ==
kContextBudget
);
29
30
static
constexpr
size_t
kRecorderBudget = 7654321;
31
skgpu::graphite::RecorderOptions
recorderOptions;
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
}
kContextBudget
static constexpr size_t kContextBudget
Definition
CacheBudgetTest.cpp:14
set_context_budget
static void set_context_budget(skgpu::graphite::ContextOptions *options)
Definition
CacheBudgetTest.cpp:16
options
const char * options
Definition
CommonFlagsConfig.cpp:43
ContextOptions.h
Context.h
reporter
reporter
Definition
FontMgrTest.cpp:39
Recorder.h
Test.h
REPORTER_ASSERT
#define REPORTER_ASSERT(r, cond,...)
Definition
Test.h:286
ERRORF
#define ERRORF(r,...)
Definition
Test.h:293
DEF_CONDITIONAL_GRAPHITE_TEST_FOR_CONTEXTS
#define DEF_CONDITIONAL_GRAPHITE_TEST_FOR_CONTEXTS( name, context_filter, reporter, graphite_ctx, test_ctx, opt_filter, cond, ctsEnforcement)
Definition
Test.h:337
CtsEnforcement::kNextRelease
@ kNextRelease
Definition
CtsEnforcement.h:40
skgpu::graphite::ContextOptions
Definition
ContextOptions.h:20
skgpu::graphite::RecorderOptions
Definition
Recorder.h:62
skgpu::graphite::RecorderOptions::fGpuBudgetInBytes
size_t fGpuBudgetInBytes
Definition
Recorder.h:71
Generated on Fri Apr 26 2024 06:17:43 for Flutter Engine by
1.9.8