-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-Re-Land Support for rendering Android Platform Views into a Hardwa…
…reBuffer backed texture (#44326) Introduce TextureRegistry.ImageTexture and related machinery. Introduce ImageReaderPlatformViewRenderTarget. Introduce HardwareBufferExternalTextureGL and related machinery. NOTE: ImageReaderPlatformViewRenderTarget requires Android 26. NOTE: This CL does not enable using ImageReaderPlatformViewRenderTarget yet. Related flutter/flutter#130892 --------- Co-authored-by: Jason Simmons <[email protected]>
- Loading branch information
1 parent
e589d59
commit 0832dfa
Showing
36 changed files
with
1,167 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "flutter/impeller/toolkit/egl/image.h" | ||
|
||
namespace impeller {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include "flutter/fml/unique_object.h" | ||
#include "flutter/impeller/toolkit/egl/egl.h" | ||
|
||
namespace impeller { | ||
|
||
// Simple holder of an EGLImage and the owning EGLDisplay. | ||
struct EGLImageWithDisplay { | ||
EGLImage image = EGL_NO_IMAGE; | ||
EGLDisplay display = EGL_NO_DISPLAY; | ||
|
||
constexpr bool operator==(const EGLImageWithDisplay& other) const { | ||
return image == other.image && display == other.display; | ||
} | ||
|
||
constexpr bool operator!=(const EGLImageWithDisplay& other) const { | ||
return !(*this == other); | ||
} | ||
}; | ||
|
||
struct EGLImageWithDisplayTraits { | ||
static EGLImageWithDisplay InvalidValue() { | ||
return {EGL_NO_IMAGE, EGL_NO_DISPLAY}; | ||
} | ||
|
||
static bool IsValid(const EGLImageWithDisplay& value) { | ||
return value != InvalidValue(); | ||
} | ||
|
||
static void Free(EGLImageWithDisplay image) { | ||
eglDestroyImage(image.display, image.image); | ||
} | ||
}; | ||
|
||
using UniqueEGLImage = | ||
fml::UniqueObject<EGLImageWithDisplay, EGLImageWithDisplayTraits>; | ||
|
||
// Simple holder of an EGLImageKHR and the owning EGLDisplay. | ||
struct EGLImageKHRWithDisplay { | ||
EGLImageKHR image = EGL_NO_IMAGE_KHR; | ||
EGLDisplay display = EGL_NO_DISPLAY; | ||
|
||
constexpr bool operator==(const EGLImageKHRWithDisplay& other) const { | ||
return image == other.image && display == other.display; | ||
} | ||
|
||
constexpr bool operator!=(const EGLImageKHRWithDisplay& other) const { | ||
return !(*this == other); | ||
} | ||
}; | ||
|
||
struct EGLImageKHRWithDisplayTraits { | ||
static EGLImageKHRWithDisplay InvalidValue() { | ||
return {EGL_NO_IMAGE_KHR, EGL_NO_DISPLAY}; | ||
} | ||
|
||
static bool IsValid(const EGLImageKHRWithDisplay& value) { | ||
return value != InvalidValue(); | ||
} | ||
|
||
static void Free(EGLImageKHRWithDisplay image) { | ||
eglDestroyImageKHR(image.display, image.image); | ||
} | ||
}; | ||
|
||
using UniqueEGLImageKHR = | ||
fml::UniqueObject<EGLImageKHRWithDisplay, EGLImageKHRWithDisplayTraits>; | ||
|
||
} // namespace impeller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2013 The Flutter Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("../../tools/impeller.gni") | ||
|
||
impeller_component("gles") { | ||
sources = [ | ||
"gles.h", | ||
"texture.cc", | ||
"texture.h", | ||
] | ||
|
||
deps = [ | ||
"../../base", | ||
"//flutter/fml", | ||
] | ||
|
||
libs = [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include "GLES3/gl3.h" | ||
#define GL_GLEXT_PROTOTYPES | ||
#include "GLES2/gl2ext.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "flutter/impeller/toolkit/gles/texture.h" | ||
|
||
namespace impeller {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include "flutter/fml/unique_object.h" | ||
#include "flutter/impeller/toolkit/gles/gles.h" | ||
|
||
namespace impeller { | ||
|
||
// Simple holder of an GLTexture and the owning EGLDisplay. | ||
struct GLTexture { | ||
GLuint texture_name; | ||
|
||
constexpr bool operator==(const GLTexture& other) const { | ||
return texture_name == other.texture_name; | ||
} | ||
|
||
constexpr bool operator!=(const GLTexture& other) const { | ||
return !(*this == other); | ||
} | ||
}; | ||
|
||
struct GLTextureTraits { | ||
static GLTexture InvalidValue() { return {0}; } | ||
|
||
static bool IsValid(const GLTexture& value) { | ||
return value != InvalidValue(); | ||
} | ||
|
||
static void Free(GLTexture image) { | ||
glDeleteTextures(1, &image.texture_name); | ||
} | ||
}; | ||
|
||
using UniqueGLTexture = fml::UniqueObject<GLTexture, GLTextureTraits>; | ||
|
||
} // namespace impeller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.