OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layers/io_surface_layer_impl.h" | 5 #include "cc/layers/io_surface_layer_impl.h" |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "cc/layers/quad_sink.h" | 8 #include "cc/layers/quad_sink.h" |
9 #include "cc/output/gl_renderer.h" // For the GLC() macro. | 9 #include "cc/output/gl_renderer.h" // For the GLC() macro. |
10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 if (!context3d) { | 70 if (!context3d) { |
71 // FIXME: Implement this path for software compositing. | 71 // FIXME: Implement this path for software compositing. |
72 return; | 72 return; |
73 } | 73 } |
74 | 74 |
75 // FIXME: Do this in a way that we can track memory usage. | 75 // FIXME: Do this in a way that we can track memory usage. |
76 if (!io_surface_texture_id_) { | 76 if (!io_surface_texture_id_) { |
77 io_surface_texture_id_ = context3d->createTexture(); | 77 io_surface_texture_id_ = context3d->createTexture(); |
78 io_surface_resource_id_ = | 78 io_surface_resource_id_ = |
79 resource_provider->CreateResourceFromExternalTexture( | 79 resource_provider->CreateResourceFromExternalTexture( |
80 GL_TEXTURE_2D, | |
danakj
2013/04/17 19:57:49
Should this be GL_TEXTURE_RECTANGLE_ARB? Other IO
boliu
2013/04/17 20:00:39
Done.
| |
80 io_surface_texture_id_); | 81 io_surface_texture_id_); |
81 } | 82 } |
82 | 83 |
83 GLC(context3d, context3d->activeTexture(GL_TEXTURE0)); | 84 GLC(context3d, context3d->activeTexture(GL_TEXTURE0)); |
84 GLC(context3d, | 85 GLC(context3d, |
85 context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB, | 86 context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB, |
86 io_surface_texture_id_)); | 87 io_surface_texture_id_)); |
87 GLC(context3d, | 88 GLC(context3d, |
88 context3d->texParameteri( | 89 context3d->texParameteri( |
89 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); | 90 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 | 155 |
155 io_surface_id_ = io_surface_id; | 156 io_surface_id_ = io_surface_id; |
156 io_surface_size_ = size; | 157 io_surface_size_ = size; |
157 } | 158 } |
158 | 159 |
159 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { | 160 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { |
160 return "IOSurfaceLayer"; | 161 return "IOSurfaceLayer"; |
161 } | 162 } |
162 | 163 |
163 } // namespace cc | 164 } // namespace cc |
OLD | NEW |