Flutter Engine
The Flutter Engine
third_party
skia
tools
window
WindowContext.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2023 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 "
tools/window/WindowContext.h
"
9
10
#include "
include/gpu/GrDirectContext.h
"
11
#if defined(SK_GRAPHITE)
12
#include "
include/gpu/graphite/Context.h
"
13
#include "
include/gpu/graphite/Recorder.h
"
14
#endif
15
16
namespace
skwindow
{
17
18
WindowContext::WindowContext
(
const
DisplayParams
&
params
)
19
: fDisplayParams(
params
) {}
20
21
WindowContext::~WindowContext
() {}
22
23
void
WindowContext::swapBuffers
() {
24
this->
onSwapBuffers
();
25
}
26
27
#if defined(SK_GRAPHITE)
28
void
WindowContext::snapRecordingAndSubmit() {
29
if
(fGraphiteContext) {
30
SkASSERT
(fGraphiteRecorder);
31
std::unique_ptr<skgpu::graphite::Recording> recording = fGraphiteRecorder->snap();
32
if
(recording) {
33
skgpu::graphite::InsertRecordingInfo
info
;
34
info
.fRecording = recording.get();
35
fGraphiteContext->insertRecording(
info
);
36
fGraphiteContext->submit(
skgpu::graphite::SyncToCpu::kNo
);
37
}
38
}
39
}
40
#endif
41
42
}
// namespace skwindow
Context.h
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
GrDirectContext.h
Recorder.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
WindowContext.h
skwindow::WindowContext::~WindowContext
virtual ~WindowContext()
Definition:
WindowContext.cpp:21
skwindow::WindowContext::WindowContext
WindowContext(const DisplayParams &)
Definition:
WindowContext.cpp:18
skwindow::WindowContext::swapBuffers
void swapBuffers()
Definition:
WindowContext.cpp:23
skwindow::WindowContext::onSwapBuffers
virtual void onSwapBuffers()=0
params
const EmbeddedViewParams * params
Definition:
embedder_external_view_embedder.cc:138
skgpu::graphite::SyncToCpu::kNo
@ kNo
skwindow
Definition:
Window.h:34
skgpu::graphite::InsertRecordingInfo
Definition:
GraphiteTypes.h:60
skwindow::DisplayParams
Definition:
DisplayParams.h:47
Generated on Sun Jun 23 2024 21:56:53 for Flutter Engine by
1.9.4