Skip to content

Commit 81a66c8

Browse files
committed
Apply review's comment
* Remove redundant code Signed-off-by: MuHong Byun <[email protected]>
1 parent 636f8e5 commit 81a66c8

File tree

2 files changed

+5
-53
lines changed

2 files changed

+5
-53
lines changed

shell/platform/tizen/external_texture_pixel_gl_stub.cc

+3-39
Original file line numberDiff line numberDiff line change
@@ -29,49 +29,13 @@ bool ExternalTexturePixelGL::PopulateTexture(
2929
size_t width,
3030
size_t height,
3131
FlutterOpenGLTexture* opengl_texture) {
32-
if (!CopyPixelBuffer(width, height)) {
33-
return false;
34-
}
35-
36-
// Populate the texture object used by the engine.
37-
opengl_texture->target = GL_TEXTURE_2D;
38-
opengl_texture->name = state_->gl_texture;
39-
opengl_texture->format = GL_RGBA8;
40-
opengl_texture->destruction_callback = nullptr;
41-
opengl_texture->user_data = nullptr;
42-
opengl_texture->width = width;
43-
opengl_texture->height = height;
44-
return true;
32+
return CopyPixelBuffer(width, height);
4533
}
4634

4735
bool ExternalTexturePixelGL::CopyPixelBuffer(size_t& width, size_t& height) {
48-
if (!texture_callback_) {
49-
return false;
50-
}
51-
52-
const FlutterDesktopPixelBuffer* pixel_buffer =
53-
texture_callback_(width, height, user_data_);
54-
55-
if (!pixel_buffer || !pixel_buffer->buffer) {
56-
return false;
57-
}
58-
59-
width = pixel_buffer->width;
60-
height = pixel_buffer->height;
61-
62-
if (state_->gl_texture == 0) {
63-
glGenTextures(1, &state_->gl_texture);
64-
glBindTexture(GL_TEXTURE_2D, state_->gl_texture);
65-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
66-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
67-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
68-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
69-
} else {
70-
glBindTexture(GL_TEXTURE_2D, state_->gl_texture);
36+
if (texture_callback_ && user_data_) {
37+
return true;
7138
}
72-
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, pixel_buffer->width,
73-
pixel_buffer->height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
74-
pixel_buffer->buffer);
7539
return true;
7640
}
7741
} // namespace flutter

shell/platform/tizen/external_texture_surface_gl_stub.cc

+2-14
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,9 @@ bool ExternalTextureSurfaceGL::PopulateTexture(
2626
size_t width,
2727
size_t height,
2828
FlutterOpenGLTexture* opengl_texture) {
29-
if (!texture_callback_) {
30-
return false;
29+
if (texture_callback_ && destruction_callback_ && user_data_) {
30+
return true;
3131
}
32-
33-
const FlutterDesktopGpuBuffer* gpu_buffer =
34-
texture_callback_(width, height, user_data_);
35-
if (!gpu_buffer) {
36-
FT_LOGI("[texture id:%ld] gpu_buffer is null", texture_id_);
37-
return false;
38-
}
39-
if (!gpu_buffer->buffer) {
40-
FT_LOGI("[texture id:%ld] tbm_surface_ is null", texture_id_);
41-
return false;
42-
}
43-
FT_UNIMPLEMENTED();
4432
return false;
4533
}
4634

0 commit comments

Comments
 (0)