Skip to content

Commit e36064c

Browse files
committed
removed mutable fields form texture_gles
1 parent 496e76f commit e36064c

3 files changed

Lines changed: 13 additions & 15 deletions

File tree

engine/src/flutter/impeller/renderer/backend/gles/buffer_bindings_gles.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ std::optional<size_t> BufferBindingsGLES::BindTextures(
474474
//--------------------------------------------------------------------------
475475
/// Bind the texture.
476476
///
477-
if (!texture_gles.Bind()) {
477+
if (!const_cast<TextureGLES&>(texture_gles).Bind()) {
478478
return std::nullopt;
479479
}
480480

engine/src/flutter/impeller/renderer/backend/gles/texture_gles.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ TextureGLES::Type TextureGLES::ComputeTypeForBinding(GLenum target) const {
349349
return type_;
350350
}
351351

352-
void TextureGLES::InitializeContentsIfNecessary() const {
352+
void TextureGLES::InitializeContentsIfNecessary() {
353353
if (!IsValid() || slices_initialized_[0]) {
354354
return;
355355
}
@@ -450,7 +450,7 @@ std::optional<GLuint> TextureGLES::GetGLHandle() const {
450450
return reactor_->GetGLHandle(handle_);
451451
}
452452

453-
bool TextureGLES::Bind() const {
453+
bool TextureGLES::Bind() {
454454
auto handle = GetGLHandle();
455455
if (!handle.has_value()) {
456456
return false;
@@ -491,7 +491,7 @@ void TextureGLES::MarkContentsInitialized() {
491491
}
492492
}
493493

494-
void TextureGLES::MarkSliceInitialized(size_t slice) const {
494+
void TextureGLES::MarkSliceInitialized(size_t slice) {
495495
slices_initialized_[slice] = true;
496496
}
497497

@@ -548,9 +548,8 @@ static GLenum ToAttachmentType(TextureGLES::AttachmentType point) {
548548
}
549549
}
550550

551-
bool TextureGLES::SetAsFramebufferAttachment(
552-
GLenum target,
553-
AttachmentType attachment_type) const {
551+
bool TextureGLES::SetAsFramebufferAttachment(GLenum target,
552+
AttachmentType attachment_type) {
554553
if (!IsValid()) {
555554
return false;
556555
}

engine/src/flutter/impeller/renderer/backend/gles/texture_gles.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class TextureGLES final : public Texture,
8787

8888
std::optional<GLuint> GetGLHandle() const;
8989

90-
[[nodiscard]] bool Bind() const;
90+
[[nodiscard]] bool Bind();
9191

9292
[[nodiscard]] bool GenerateMipmap();
9393

@@ -96,9 +96,8 @@ class TextureGLES final : public Texture,
9696
kDepth,
9797
kStencil,
9898
};
99-
[[nodiscard]] bool SetAsFramebufferAttachment(
100-
GLenum target,
101-
AttachmentType attachment_type) const;
99+
[[nodiscard]] bool SetAsFramebufferAttachment(GLenum target,
100+
AttachmentType attachment_type);
102101

103102
Type GetType() const;
104103

@@ -126,7 +125,7 @@ class TextureGLES final : public Texture,
126125
///
127126
/// @param[in] slice The slice to mark as being initialized.
128127
///
129-
void MarkSliceInitialized(size_t slice) const;
128+
void MarkSliceInitialized(size_t slice);
130129

131130
bool IsSliceInitialized(size_t slice) const;
132131

@@ -157,8 +156,8 @@ class TextureGLES final : public Texture,
157156
std::shared_ptr<ReactorGLES> reactor_;
158157
const Type type_;
159158
HandleGLES handle_;
160-
mutable std::optional<HandleGLES> fence_ = std::nullopt;
161-
mutable std::bitset<6> slices_initialized_ = 0;
159+
std::optional<HandleGLES> fence_ = std::nullopt;
160+
std::bitset<6> slices_initialized_ = 0;
162161
const bool is_wrapped_;
163162
const std::optional<GLuint> wrapped_fbo_;
164163
HandleGLES cached_fbo_ = HandleGLES::DeadHandle();
@@ -191,7 +190,7 @@ class TextureGLES final : public Texture,
191190
// |Texture|
192191
Scalar GetYCoordScale() const override;
193192

194-
void InitializeContentsIfNecessary() const;
193+
void InitializeContentsIfNecessary();
195194

196195
TextureGLES(const TextureGLES&) = delete;
197196

0 commit comments

Comments
 (0)