Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions shell/gpu/gpu_surface_gl_skia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrContextOptions.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"

// These are common defines present on all OpenGL headers. However, we don't
// want to perform GL header reasolution on each platform we support. So just
// want to perform GL header resolution on each platform we support. So just
// define these upfront. It is unlikely we will need more. But, if we do, we can
// add the same here.
#define GPU_GL_RGBA8 0x8058
Expand Down Expand Up @@ -138,12 +140,13 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrDirectContext* context,
framebuffer_info.fFBOID = static_cast<GrGLuint>(fbo);
framebuffer_info.fFormat = format;

GrBackendRenderTarget render_target(size.width(), // width
size.height(), // height
0, // sample count
0, // stencil bits
framebuffer_info // framebuffer info
);
auto render_target =
GrBackendRenderTargets::MakeGL(size.width(), // width
size.height(), // height
0, // sample count
0, // stencil bits
framebuffer_info // framebuffer info
);

sk_sp<SkColorSpace> colorspace = SkColorSpace::MakeSRGB();
SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);
Expand Down
5 changes: 4 additions & 1 deletion shell/platform/android/android_external_texture_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"

namespace flutter {

Expand Down Expand Up @@ -60,7 +62,8 @@ void AndroidExternalTextureGL::Paint(PaintContext& context,
}
GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_,
GL_RGBA8_OES};
GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo);
auto backendTexture =
GrBackendTextures::MakeGL(1, 1, skgpu::Mipmapped::kNo, textureInfo);
sk_sp<SkImage> image = SkImages::BorrowTextureFrom(
context.gr_context, backendTexture, kTopLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"

namespace flutter {

Expand Down Expand Up @@ -54,7 +56,8 @@ void HardwareBufferExternalTextureGL::Paint(PaintContext& context,
}
GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES,
texture_.get().texture_name, GL_RGBA8_OES};
GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo);
auto backendTexture =
GrBackendTextures::MakeGL(1, 1, skgpu::Mipmapped::kNo, textureInfo);
sk_sp<SkImage> image = SkImages::BorrowTextureFrom(
context.gr_context, backendTexture, kTopLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr);
Expand Down
24 changes: 13 additions & 11 deletions shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ extern const intptr_t kPlatformStrongDillSize;
// embedder/BUILD.gn variable impeller_supports_rendering is disabled.
#ifdef SHELL_ENABLE_GL
#include "flutter/shell/platform/embedder/embedder_external_texture_gl.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"
#ifdef IMPELLER_SUPPORTS_RENDERING
#include "flutter/shell/platform/embedder/embedder_render_target_impeller.h" // nogncheck
#include "flutter/shell/platform/embedder/embedder_surface_gl_impeller.h" // nogncheck
Expand Down Expand Up @@ -742,10 +744,10 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
texture_info.fID = texture->name;
texture_info.fFormat = texture->format;

GrBackendTexture backend_texture(config.size.width, //
config.size.height, //
GrMipMapped::kNo, //
texture_info //
auto backend_texture = GrBackendTextures::MakeGL(config.size.width, //
config.size.height, //
skgpu::Mipmapped::kNo, //
texture_info //
);

SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
Expand Down Expand Up @@ -783,13 +785,13 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
framebuffer_info.fFormat = framebuffer->target;
framebuffer_info.fFBOID = framebuffer->name;

GrBackendRenderTarget backend_render_target(
config.size.width, // width
config.size.height, // height
1, // sample count
0, // stencil bits
framebuffer_info // framebuffer info
);
auto backend_render_target =
GrBackendRenderTargets::MakeGL(config.size.width, // width
config.size.height, // height
1, // sample count
0, // stencil bits
framebuffer_info // framebuffer info
);

SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);

Expand Down
6 changes: 4 additions & 2 deletions shell/platform/embedder/embedder_external_texture_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"

namespace flutter {

Expand Down Expand Up @@ -77,8 +79,8 @@ sk_sp<DlImage> EmbedderExternalTextureGL::ResolveTexture(
height = texture->height;
}

GrBackendTexture gr_backend_texture(width, height, GrMipMapped::kNo,
gr_texture_info);
auto gr_backend_texture = GrBackendTextures::MakeGL(
width, height, skgpu::Mipmapped::kNo, gr_texture_info);
SkImages::TextureReleaseProc release_proc = texture->destruction_callback;
auto image =
SkImages::BorrowTextureFrom(context, // context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"

#include <cstdlib>
#include <memory>
Expand Down Expand Up @@ -111,7 +113,8 @@ bool EmbedderTestBackingStoreProducer::CreateFramebuffer(
}

GrGLFramebufferInfo framebuffer_info = {};
if (!render_target.getGLFramebufferInfo(&framebuffer_info)) {
if (!GrBackendRenderTargets::GetGLFramebufferInfo(render_target,
&framebuffer_info)) {
FML_LOG(ERROR) << "Could not access backend framebuffer info.";
return false;
}
Expand Down Expand Up @@ -164,7 +167,7 @@ bool EmbedderTestBackingStoreProducer::CreateTexture(
}

GrGLTextureInfo texture_info = {};
if (!render_texture.getGLTextureInfo(&texture_info)) {
if (!GrBackendTextures::GetGLTextureInfo(render_texture, &texture_info)) {
FML_LOG(ERROR) << "Could not access backend texture info.";
return false;
}
Expand Down
16 changes: 9 additions & 7 deletions testing/test_gl_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/gl/GrGLAssembleInterface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"

namespace flutter {
namespace testing {
Expand Down Expand Up @@ -351,13 +353,13 @@ sk_sp<SkSurface> TestGLSurface::GetOnscreenSurface() {
framebuffer_info.fFormat = 0x93A1; // GL_BGRA8;
#endif

GrBackendRenderTarget backend_render_target(
width, // width
height, // height
1, // sample count
8, // stencil bits
framebuffer_info // framebuffer info
);
auto backend_render_target =
GrBackendRenderTargets::MakeGL(width, // width
height, // height
1, // sample count
8, // stencil bits
framebuffer_info // framebuffer info
);

SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);

Expand Down