Flutter Engine
The Flutter Engine
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
13
14static constexpr size_t kContextBudget = 1234567;
15
17 options->fGpuBudgetInBytes = kContextBudget;
18}
19
21 nullptr,
23 context,
24 testContext,
26 true,
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
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)
const char * options
reporter
Definition: FontMgrTest.cpp:39
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
#define ERRORF(r,...)
Definition: Test.h:293