main/framebuffer: refactor _mesa_get_color_read_format/type
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 17 Jan 2017 20:06:36 +0000 (18:06 -0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Mon, 6 Feb 2017 07:50:21 +0000 (08:50 +0100)
commit0cd2a4737eb189fb37ff53c7583c8e4aa2d5a630
tree6409b24e8cf23f2fb6221e5e5b2e55e507f5f158
parent106a51440d018031b94c91758eecc7424a3bb5ee
main/framebuffer: refactor _mesa_get_color_read_format/type

Current implementation returns the value for the currently bound read
framebuffer. GetNamedFramebufferParameteriv allows to get it for any
given framebuffer. GetFramebufferParameteriv would be also interested
on that method

It was refactored by allowing to pass a given framebuffer. If NULL is
passed, it used the currently bound framebuffer.

It also adds a call to _mesa_update_state. When used only by
GetIntegerv, this one was called as part of the extra checks defined
at get_hash. But now that the method is used by more methods, and the
update is needed, it makes sense (and it is safer) just calling it on
the method itself, instead of rely on the caller.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/framebuffer.c
src/mesa/main/framebuffer.h
src/mesa/main/get.c
src/mesa/main/readpix.c