summaryrefslogtreecommitdiff
path: root/glamor/glamor_core.c
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-06-11 01:02:30 +0800
committerEric Anholt <eric@anholt.net>2013-12-18 11:23:51 -0800
commitace35e408cd7a79c5215bbd0f14b624d8d949e34 (patch)
tree5ba5cb1fc4a129d3668eda246e41a6bf8a772d22 /glamor/glamor_core.c
parent4c174f4c9ce1514ef226e9de97e5c87a46a75524 (diff)
glamor_largepixmap: first commit for large pixmap.
This is the first commit to add support for large pixmap. The large here means a pixmap is larger than the texutre's size limitation thus can't fit into one single texutre. The previous implementation will simply fallback to use a in memory pixmap to contain the large pixmap which is very slow in practice. The basic idea here is to use an array of texture to hold the large pixmap. And when we need to get a specific area of the pixmap, we just need to compute/clip the correct region and find the corresponding fbo. We need to implement some auxiliary routines to clip every rendering operations into small pieces which can fit into one texture. The complex part is the transformation/repeat/repeatReflect and repeat pad and their comination. We will support all of them step by step. This commit just add some necessary data structure to represent the large pixmap, and doesn't change any rendering process. This commit doesn't add real large pixmap support. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'glamor/glamor_core.c')
-rw-r--r--glamor/glamor_core.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
index 009a0899b..8ba3347d1 100644
--- a/glamor/glamor_core.c
+++ b/glamor/glamor_core.c
@@ -43,9 +43,9 @@ glamor_get_drawable_location(const DrawablePtr drawable)
glamor_get_pixmap_private(pixmap);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(drawable->pScreen);
- if (pixmap_priv == NULL || pixmap_priv->gl_fbo == 0)
+ if (pixmap_priv == NULL || pixmap_priv->base.gl_fbo == 0)
return 'm';
- if (pixmap_priv->fbo->fb == glamor_priv->screen_fbo)
+ if (pixmap_priv->base.fbo->fb == glamor_priv->screen_fbo)
return 's';
else
return 'f';
@@ -327,7 +327,7 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode)
glamor_restore_pixmap_to_texture(pixmap);
}
- if (pixmap_priv->fbo->pbo != 0 && pixmap_priv->fbo->pbo_valid) {
+ if (pixmap_priv->base.fbo->pbo != 0 && pixmap_priv->base.fbo->pbo_valid) {
glamor_gl_dispatch *dispatch;
assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP);
@@ -335,20 +335,20 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode)
dispatch = glamor_get_dispatch(glamor_priv);
dispatch->glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
dispatch->glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
- dispatch->glDeleteBuffers(1, &pixmap_priv->fbo->pbo);
+ dispatch->glDeleteBuffers(1, &pixmap_priv->base.fbo->pbo);
glamor_put_dispatch(glamor_priv);
- pixmap_priv->fbo->pbo_valid = FALSE;
- pixmap_priv->fbo->pbo = 0;
+ pixmap_priv->base.fbo->pbo_valid = FALSE;
+ pixmap_priv->base.fbo->pbo = 0;
} else {
free(pixmap->devPrivate.ptr);
}
if (pixmap_priv->type == GLAMOR_TEXTURE_DRM)
- pixmap->devKind = pixmap_priv->drm_stride;
+ pixmap->devKind = pixmap_priv->base.drm_stride;
- if (pixmap_priv->gl_fbo == GLAMOR_FBO_DOWNLOADED)
- pixmap_priv->gl_fbo = GLAMOR_FBO_NORMAL;
+ if (pixmap_priv->base.gl_fbo == GLAMOR_FBO_DOWNLOADED)
+ pixmap_priv->base.gl_fbo = GLAMOR_FBO_NORMAL;
pixmap->devPrivate.ptr = NULL;
}