[Mesa-dev] [PATCH 4/5] intel: Move inline functions from intel_fbo.h to intel_fbo.c

Chad Versace chad at chad-versace.us
Thu Oct 27 18:55:50 PDT 2011


Move the following inline functions:
    intel_get_rb_region
    intel_framebuffer_has_hiz

A future commit will replace the renderbuffer's region with a miptree.
This small refactor will eliminate the need for intel_fbo.h to include
intel_mipmap_tree.h on that commit. I'd like to avoid the situation where
each header transitively includes every other header.

Signed-off-by: Chad Versace <chad at chad-versace.us>
---
 src/mesa/drivers/dri/intel/intel_fbo.c |   19 +++++++++++++++++++
 src/mesa/drivers/dri/intel/intel_fbo.h |   21 ++++-----------------
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 7a24d06..d870e25 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -53,6 +53,25 @@
 #define FILE_DEBUG_FLAG DEBUG_FBO
 
 
+bool
+intel_framebuffer_has_hiz(struct gl_framebuffer *fb)
+{
+   struct intel_renderbuffer *rb = NULL;
+   if (fb)
+      rb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
+   return rb && rb->hiz_region;
+}
+
+struct intel_region*
+intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
+{
+   struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
+   if (irb)
+      return irb->region;
+   else
+      return NULL;
+}
+
 /**
  * Create a new framebuffer object.
  */
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index 7e2f490..8fb4393 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -131,14 +131,8 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, gl_buffer_index attIndex)
    return irb;
 }
 
-static inline bool
-intel_framebuffer_has_hiz(struct gl_framebuffer *fb)
-{
-   struct intel_renderbuffer *rb = NULL;
-   if (fb)
-      rb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
-   return rb && rb->hiz_region;
-}
+bool
+intel_framebuffer_has_hiz(struct gl_framebuffer *fb);
 
 extern struct intel_renderbuffer *
 intel_create_renderbuffer(gl_format format);
@@ -171,14 +165,7 @@ intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
 				uint32_t *tile_x,
 				uint32_t *tile_y);
 
-static INLINE struct intel_region *
-intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
-{
-   struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
-   if (irb)
-      return irb->region;
-   else
-      return NULL;
-}
+struct intel_region*
+intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex);
 
 #endif /* INTEL_FBO_H */
-- 
1.7.6.4



More information about the mesa-dev mailing list