Flutter Engine
The 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
5#include "flutter/shell/platform/android/context/android_context.h"
6
7namespace flutter {
8
10 : rendering_api_(rendering_api) {}
11
13 if (main_context_) {
14 main_context_->releaseResourcesAndAbandonContext();
15 }
16 if (impeller_context_) {
17 impeller_context_->Shutdown();
18 }
19};
20
22 return rendering_api_;
23}
24
26 return true;
27}
28
30 const sk_sp<GrDirectContext>& main_context) {
31 main_context_ = main_context;
32}
33
35 return main_context_;
36}
37
38std::shared_ptr<impeller::Context> AndroidContext::GetImpellerContext() const {
39 return impeller_context_;
40}
41
43 const std::shared_ptr<impeller::Context>& context) {
44 impeller_context_ = context;
45}
46
47} // namespace flutter
void releaseResourcesAndAbandonContext()
void SetMainSkiaContext(const sk_sp< GrDirectContext > &main_context)
Setter for the Skia context to be used by subsequent AndroidSurfaces.
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 > &context)
std::shared_ptr< impeller::Context > GetImpellerContext() const
Accessor for the Impeller context associated with AndroidSurfaces and the raster thread.
AndroidRenderingAPI
Definition settings.h:26