Skip to content

Commit d5a2847

Browse files
committed
Fix poor variable name choices
1 parent 67af875 commit d5a2847

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/flitter/render/window/canvas.pyx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,14 @@ class Canvas(SceneNode):
893893
if not linear or colorbits not in COLOR_FORMATS:
894894
colorbits = 8
895895
if resized or colorbits != self._colorbits or linear != self._linear:
896-
depth = COLOR_FORMATS[colorbits]
897-
skia_colortype = TextureFormatColorType[depth.moderngl_dtype][1]
898-
internal_format = None if linear else GL_SRGB8_ALPHA8
896+
color_format = COLOR_FORMATS[colorbits]
897+
skia_colortype = TextureFormatColorType[color_format.moderngl_dtype][1]
898+
internal_format = color_format.gl_format if linear else GL_SRGB8_ALPHA8
899899
self._colorspace = skia.ColorSpace.MakeSRGBLinear() if linear else skia.ColorSpace.MakeSRGB()
900-
self._texture = self.glctx.texture((self.width, self.height), 4, dtype=depth.moderngl_dtype, internal_format=internal_format)
900+
self._texture = self.glctx.texture((self.width, self.height), 4, dtype=color_format.moderngl_dtype, internal_format=internal_format)
901901
self._framebuffer = self.glctx.framebuffer(color_attachments=(self._texture,))
902-
backend_render_target = skia.GrBackendRenderTarget(self.width, self.height, 0, 0, skia.GrGLFramebufferInfo(self._framebuffer.glo, depth.gl_format))
902+
backend_render_target = skia.GrBackendRenderTarget(self.width, self.height, 0, 0,
903+
skia.GrGLFramebufferInfo(self._framebuffer.glo, color_format.gl_format))
903904
self._surface = skia.Surface.MakeFromBackendRenderTarget(self._graphics_context, backend_render_target, skia.kBottomLeft_GrSurfaceOrigin,
904905
skia_colortype, self._colorspace)
905906
self._canvas = self._surface.getCanvas()

0 commit comments

Comments
 (0)