提交 1073db38 编写于 作者: D Dan Field

merge

......@@ -26,7 +26,7 @@ vars = {
'skia_git': 'https://skia.googlesource.com',
# OCMock is for testing only so there is no google clone
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
'skia_revision': '9a4904f4e0cf44fd1564825d466c2d15a760cd5a',
'skia_revision': 'aed808c7567ebd46b17663d3e4917616ba4a1953',
# When updating the Dart revision, ensure that all entries that are
# dependencies of Dart are also updated to match the entries in the
......@@ -34,7 +34,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '28ec4cc111cf59fe87f61cfe36004df613d2e62b',
'dart_revision': '7fcbd388b620b2e3c28fac230f39a9a70226a543',
# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
......@@ -207,7 +207,7 @@ deps = {
Var('dart_git') + '/html.git@22f17e97fedeacaa1e945cf84d8016284eed33a6',
'src/third_party/dart/third_party/pkg/http':
Var('dart_git') + '/http.git@1617b728fc48f64fb0ed7dc16078c03adcc64179',
Var('dart_git') + '/http.git@3845753a54624b070828cb3eff7a6c2a4e046cfb',
'src/third_party/dart/third_party/pkg/http_multi_server':
Var('dart_git') + '/http_multi_server.git@e8c8be7f15b4fb50757ff5bf29766721fbe24fe4',
......
Signature: 8e3f70acf0b4593f9cd39774badade61
Signature: 44e165542aa385d44eb647a22eb5d148
UNUSED LICENSES:
......
......@@ -30,8 +30,17 @@ FLUTTER_ASSERT_NOT_ARC
XCTAssertNotNil(spawn);
XCTAssertTrue([engine iosPlatformView] != nullptr);
XCTAssertTrue([spawn iosPlatformView] != nullptr);
XCTAssertEqual([engine iosPlatformView]->GetIosContext(),
[spawn iosPlatformView]->GetIosContext());
std::shared_ptr<flutter::IOSContext> engine_context = [engine iosPlatformView]->GetIosContext();
std::shared_ptr<flutter::IOSContext> spawn_context = [spawn iosPlatformView]->GetIosContext();
XCTAssertEqual(engine_context, spawn_context);
// If this assert fails it means we may be using the software or OpenGL
// renderer when we were expecting Metal. For software rendering, this is
// expected to be nullptr. For OpenGL, implementing this is an outstanding
// change see https://github.com/flutter/flutter/issues/73744.
XCTAssertTrue(engine_context->GetMainContext() != nullptr);
XCTAssertEqual(engine_context->GetMainContext(), spawn_context->GetMainContext());
[engine release];
[spawn release];
}
@end
......@@ -106,6 +106,20 @@ class IOSContext {
int64_t texture_id,
fml::scoped_nsobject<NSObject<FlutterTexture>> texture) = 0;
//----------------------------------------------------------------------------
/// @brief Accessor for the Skia context associated with IOSSurfaces and
/// the raster thread.
/// @details There can be any number of resource contexts but this is the
/// one context that will be used by surfaces to draw to the
/// screen from the raster thread.
/// @returns `nullptr` on failure.
/// @attention The software context doesn't have a Skia context, so this
/// value will be nullptr.
/// @see For contexts which are used for offscreen work like loading
/// textures see IOSContext::CreateResourceContext.
///
virtual sk_sp<GrDirectContext> GetMainContext() const = 0;
protected:
IOSContext();
......
......@@ -32,6 +32,9 @@ class IOSContextGL final : public IOSContext {
// |IOSContext|
sk_sp<GrDirectContext> CreateResourceContext() override;
// |IOSContext|
sk_sp<GrDirectContext> GetMainContext() const override;
// |IOSContext|
std::unique_ptr<GLContextResult> MakeCurrent() override;
......
......@@ -43,6 +43,16 @@ sk_sp<GrDirectContext> IOSContextGL::CreateResourceContext() {
GrBackend::kOpenGL_GrBackend, GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface());
}
// |IOSContext|
sk_sp<GrDirectContext> IOSContextGL::GetMainContext() const {
/// TODO(73744): Currently the GPUSurfaceGL creates the main context for
/// OpenGL. With Metal the IOSContextMetal creates the main context and is
/// shared across surfaces. We should refactor the OpenGL Context/Surfaces to
/// behave like the Metal equivalents. Until then engines in the same group
/// will have a heavier memory cost if they are using OpenGL.
return nullptr;
}
// |IOSContext|
std::unique_ptr<GLContextResult> IOSContextGL::MakeCurrent() {
return std::make_unique<GLContextSwitch>(
......
......@@ -24,7 +24,8 @@ class IOSContextMetal final : public IOSContext {
fml::scoped_nsobject<FlutterDarwinContextMetal> GetDarwinContext() const;
sk_sp<GrDirectContext> GetMainContext() const;
// |IOSContext|
sk_sp<GrDirectContext> GetMainContext() const override;
sk_sp<GrDirectContext> GetResourceContext() const;
......
......@@ -20,6 +20,9 @@ class IOSContextSoftware final : public IOSContext {
// |IOSContext|
sk_sp<GrDirectContext> CreateResourceContext() override;
// |IOSContext|
sk_sp<GrDirectContext> GetMainContext() const override;
// |IOSContext|
std::unique_ptr<GLContextResult> MakeCurrent() override;
......
......@@ -16,6 +16,11 @@ sk_sp<GrDirectContext> IOSContextSoftware::CreateResourceContext() {
return nullptr;
}
// |IOSContext|
sk_sp<GrDirectContext> IOSContextSoftware::GetMainContext() const {
return nullptr;
}
// |IOSContext|
std::unique_ptr<GLContextResult> IOSContextSoftware::MakeCurrent() {
// This only makes sense for context that need to be bound to a specific thread.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册