Flutter Engine
 
Loading...
Searching...
No Matches
android_context.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7namespace flutter {
8
10 : rendering_api_(rendering_api) {}
11
13#if !SLIMPELLER
14 if (main_context_) {
15 main_context_->releaseResourcesAndAbandonContext();
16 }
17#endif // !SLIMPELLER
18 if (impeller_context_) {
19 impeller_context_->Shutdown();
20 }
21};
22
24 return rendering_api_;
25}
26
28 return true;
29}
30
32 const sk_sp<GrDirectContext>& main_context) {
33 NOT_SLIMPELLER(main_context_ = main_context);
34}
35
36sk_sp<GrDirectContext> AndroidContext::GetMainSkiaContext() const {
37#if !SLIMPELLER
38 return main_context_;
39#else
40 return nullptr;
41#endif // !SLIMPELLER
42}
43
45 const std::shared_ptr<impeller::Context>& impeller_context) {
46 impeller_context_ = impeller_context;
47}
48
49std::shared_ptr<impeller::Context> AndroidContext::GetImpellerContext() const {
50 return impeller_context_;
51}
52
54 return false;
55}
56
57} // namespace flutter
void SetMainSkiaContext(const sk_sp< GrDirectContext > &main_context)
Setter for the Skia context to be used by subsequent AndroidSurfaces.
virtual AndroidRenderingAPI RenderingApi() const
sk_sp< GrDirectContext > GetMainSkiaContext() const
Accessor for the Skia context associated with AndroidSurfaces and the raster thread.
AndroidContext(AndroidRenderingAPI rendering_api)
virtual bool IsValid() const
void SetImpellerContext(const std::shared_ptr< impeller::Context > &impeller_context)
virtual std::shared_ptr< impeller::Context > GetImpellerContext() const
Accessor for the Impeller context associated with AndroidSurfaces and the raster thread.
virtual bool IsDynamicSelection() const
#define NOT_SLIMPELLER(code)
Definition macros.h:16