1 /*
2  * Cogl
3  *
4  * A Low Level GPU Graphics and Utilities API
5  *
6  * Copyright (C) 2009,2010,2011,2012 Intel Corporation.
7  *
8  * Permission is hereby granted, free of charge, to any person
9  * obtaining a copy of this software and associated documentation
10  * files (the "Software"), to deal in the Software without
11  * restriction, including without limitation the rights to use, copy,
12  * modify, merge, publish, distribute, sublicense, and/or sell copies
13  * of the Software, and to permit persons to whom the Software is
14  * furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26  * SOFTWARE.
27  *
28  *
29  *
30  * Authors:
31  *  Neil Roberts   <neil@linux.intel.com>
32  *  Robert Bragg   <robert@linux.intel.com>
33  */
34 
35 #ifdef HAVE_CONFIG_H
36 #include "cogl-config.h"
37 #endif
38 
39 #include <string.h>
40 
41 #include "cogl-private.h"
42 #include "cogl-texture-2d-nop-private.h"
43 #include "cogl-texture-2d-private.h"
44 #include "cogl-error-private.h"
45 
46 void
_cogl_texture_2d_nop_free(CoglTexture2D * tex_2d)47 _cogl_texture_2d_nop_free (CoglTexture2D *tex_2d)
48 {
49 }
50 
51 CoglBool
_cogl_texture_2d_nop_can_create(CoglContext * ctx,int width,int height,CoglPixelFormat internal_format)52 _cogl_texture_2d_nop_can_create (CoglContext *ctx,
53                                  int width,
54                                  int height,
55                                  CoglPixelFormat internal_format)
56 {
57   return TRUE;
58 }
59 
60 void
_cogl_texture_2d_nop_init(CoglTexture2D * tex_2d)61 _cogl_texture_2d_nop_init (CoglTexture2D *tex_2d)
62 {
63 }
64 
65 CoglBool
_cogl_texture_2d_nop_allocate(CoglTexture * tex,CoglError ** error)66 _cogl_texture_2d_nop_allocate (CoglTexture *tex,
67                                CoglError **error)
68 {
69   return TRUE;
70 }
71 
72 void
_cogl_texture_2d_nop_flush_legacy_texobj_filters(CoglTexture * tex,GLenum min_filter,GLenum mag_filter)73 _cogl_texture_2d_nop_flush_legacy_texobj_filters (CoglTexture *tex,
74                                                   GLenum min_filter,
75                                                   GLenum mag_filter)
76 {
77 }
78 
79 void
_cogl_texture_2d_nop_flush_legacy_texobj_wrap_modes(CoglTexture * tex,GLenum wrap_mode_s,GLenum wrap_mode_t,GLenum wrap_mode_p)80 _cogl_texture_2d_nop_flush_legacy_texobj_wrap_modes (CoglTexture *tex,
81                                                      GLenum wrap_mode_s,
82                                                      GLenum wrap_mode_t,
83                                                      GLenum wrap_mode_p)
84 {
85 }
86 
87 void
_cogl_texture_2d_nop_copy_from_framebuffer(CoglTexture2D * tex_2d,int src_x,int src_y,int width,int height,CoglFramebuffer * src_fb,int dst_x,int dst_y,int level)88 _cogl_texture_2d_nop_copy_from_framebuffer (CoglTexture2D *tex_2d,
89                                             int src_x,
90                                             int src_y,
91                                             int width,
92                                             int height,
93                                             CoglFramebuffer *src_fb,
94                                             int dst_x,
95                                             int dst_y,
96                                             int level)
97 {
98 }
99 
100 unsigned int
_cogl_texture_2d_nop_get_gl_handle(CoglTexture2D * tex_2d)101 _cogl_texture_2d_nop_get_gl_handle (CoglTexture2D *tex_2d)
102 {
103   return 0;
104 }
105 
106 void
_cogl_texture_2d_nop_generate_mipmap(CoglTexture2D * tex_2d)107 _cogl_texture_2d_nop_generate_mipmap (CoglTexture2D *tex_2d)
108 {
109 }
110 
111 CoglBool
_cogl_texture_2d_nop_copy_from_bitmap(CoglTexture2D * tex_2d,int src_x,int src_y,int width,int height,CoglBitmap * bitmap,int dst_x,int dst_y,int level,CoglError ** error)112 _cogl_texture_2d_nop_copy_from_bitmap (CoglTexture2D *tex_2d,
113                                        int src_x,
114                                        int src_y,
115                                        int width,
116                                        int height,
117                                        CoglBitmap *bitmap,
118                                        int dst_x,
119                                        int dst_y,
120                                        int level,
121                                        CoglError **error)
122 {
123   return TRUE;
124 }
125 
126 void
_cogl_texture_2d_nop_get_data(CoglTexture2D * tex_2d,CoglPixelFormat format,size_t rowstride,uint8_t * data)127 _cogl_texture_2d_nop_get_data (CoglTexture2D *tex_2d,
128                                CoglPixelFormat format,
129                                size_t rowstride,
130                                uint8_t *data)
131 {
132 }
133