Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3cad490

Browse files
committed
Added initializers for instance variables to make sure contexts are
cleaned up and that the class behaves consistently
1 parent 7200744 commit 3cad490

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

shell/gpu/gpu_surface_gl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ GPUSurfaceGL::GPUSurfaceGL(sk_sp<GrDirectContext> gr_context,
9393
bool render_to_surface)
9494
: delegate_(delegate),
9595
context_(gr_context),
96+
context_owner_(false),
9697
render_to_surface_(render_to_surface),
9798
weak_factory_(this) {
9899
auto context_switch = delegate_->GLContextMakeCurrent();

shell/gpu/gpu_surface_gl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class GPUSurfaceGL : public Surface {
5555
sk_sp<GrDirectContext> context_;
5656
sk_sp<SkSurface> onscreen_surface_;
5757
/// FBO backing the current `onscreen_surface_`.
58-
uint32_t fbo_id_;
59-
bool context_owner_;
58+
uint32_t fbo_id_ = 0;
59+
bool context_owner_ = false;
6060
// TODO(38466): Refactor GPU surface APIs take into account the fact that an
6161
// external view embedder may want to render to the root surface. This is a
6262
// hack to make avoid allocating resources for the root surface when an
6363
// external view embedder is present.
64-
const bool render_to_surface_;
64+
const bool render_to_surface_ = true;
6565
bool valid_ = false;
6666
fml::TaskRunnerAffineWeakPtrFactory<GPUSurfaceGL> weak_factory_;
6767

0 commit comments

Comments
 (0)