~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/HostServices/SharedOpenGL/crserverlib/server_getteximage.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
void SERVER_DISPATCH_APIENTRY
15
15
crServerDispatchGetTexImage(GLenum target, GLint level, GLenum format,
16
 
                                                                                                                GLenum type, GLvoid * pixels)
 
16
                            GLenum type, GLvoid * pixels)
17
17
{
18
 
        GLsizei width, height, depth, size;
19
 
        GLvoid *buffer = NULL;
20
 
 
21
 
        cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
22
 
        cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
23
 
        cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
24
 
 
25
 
        size = crTextureSize(format, type, width, height, depth);
26
 
 
27
 
        if (size && (buffer = crAlloc(size))) {
28
 
                /* Note, the other pixel PACK parameters (default values) should
29
 
                 * be OK at this point.
30
 
                 */
31
 
                cr_server.head_spu->dispatch_table.PixelStorei(GL_PACK_ALIGNMENT, 1);
32
 
                cr_server.head_spu->dispatch_table.GetTexImage(target, level, format,
33
 
                                                                                                                                                                                                         type, buffer);
34
 
                crServerReturnValue( buffer, size );
35
 
                crFree(buffer);
36
 
        }
37
 
        else {
38
 
                /* need to return _something_ to avoid blowing up */
39
 
                GLuint dummy = 0;
40
 
                crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) );
41
 
        }
 
18
    GLsizei width, height, depth, size;
 
19
    GLvoid *buffer = NULL;
 
20
 
 
21
    cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
 
22
    cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
 
23
    cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
 
24
 
 
25
    size = crTextureSize(format, type, width, height, depth);
 
26
 
 
27
    if (size && (buffer = crAlloc(size))) {
 
28
        /* Note, the other pixel PACK parameters (default values) should
 
29
         * be OK at this point.
 
30
         */
 
31
        cr_server.head_spu->dispatch_table.PixelStorei(GL_PACK_ALIGNMENT, 1);
 
32
        cr_server.head_spu->dispatch_table.GetTexImage(target, level, format, type, buffer);
 
33
        crServerReturnValue( buffer, size );
 
34
        crFree(buffer);
 
35
    }
 
36
    else {
 
37
        /* need to return _something_ to avoid blowing up */
 
38
        GLuint dummy = 0;
 
39
        crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) );
 
40
    }
42
41
}
43
42
 
44
43
 
46
45
 
47
46
void SERVER_DISPATCH_APIENTRY
48
47
crServerDispatchGetCompressedTexImageARB(GLenum target, GLint level,
49
 
                                                                                                                                                                 GLvoid *img)
 
48
                                         GLvoid *img)
50
49
{
51
 
        GLint size;
52
 
        GLvoid *buffer=NULL;
53
 
 
54
 
        cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &size);
55
 
 
56
 
        if (size && (buffer = crAlloc(size))) {
57
 
                /* XXX the pixel PACK parameter should be OK at this point */
58
 
                cr_server.head_spu->dispatch_table.GetCompressedTexImageARB(target, level,
59
 
                                                                                                                                                                                                                                                                buffer);
60
 
                crServerReturnValue( buffer, size );
61
 
                crFree(buffer);
62
 
        }
63
 
        else {
64
 
                /* need to return _something_ to avoid blowing up */
65
 
                GLuint dummy = 0;
66
 
                crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) );
67
 
        }
 
50
    GLint size;
 
51
    GLvoid *buffer=NULL;
 
52
 
 
53
    cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &size);
 
54
 
 
55
    if (size && (buffer = crAlloc(size))) {
 
56
        /* XXX the pixel PACK parameter should be OK at this point */
 
57
        cr_server.head_spu->dispatch_table.GetCompressedTexImageARB(target, level, buffer);
 
58
        crServerReturnValue( buffer, size );
 
59
        crFree(buffer);
 
60
    }
 
61
    else {
 
62
        /* need to return _something_ to avoid blowing up */
 
63
        GLuint dummy = 0;
 
64
        crServerReturnValue( (GLvoid *) &dummy, sizeof(dummy) );
 
65
    }
68
66
}
69
67
 
70
68
#endif /* CR_ARB_texture_compression */