Chromium Code Reviews| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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_RECTANGLE_ARB, | 80 GL_TEXTURE_RECTANGLE_ARB, |
| 81 io_surface_texture_id_); | 81 io_surface_texture_id_); |
| 82 } | 82 } |
| 83 | 83 |
| 84 GLC(context3d, context3d->activeTexture(GL_TEXTURE0)); | |
|
jamesr
2013/04/19 00:05:09
what was the actual bug? this call?
danakj
2013/04/19 00:06:41
mac context virtualization is the bug on TOT.
the
danakj
2013/04/19 00:07:05
I think this call is just redundant cuz we're alwa
| |
| 85 GLC(context3d, | 84 GLC(context3d, |
| 86 context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB, | 85 context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB, |
| 87 io_surface_texture_id_)); | 86 io_surface_texture_id_)); |
| 88 GLC(context3d, | |
| 89 context3d->texParameteri( | |
| 90 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); | |
| 91 GLC(context3d, | |
| 92 context3d->texParameteri( | |
| 93 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); | |
| 94 GLC(context3d, | |
| 95 context3d->texParameteri( | |
| 96 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); | |
| 97 GLC(context3d, | |
| 98 context3d->texParameteri( | |
| 99 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); | |
| 100 context3d->texImageIOSurface2DCHROMIUM(GL_TEXTURE_RECTANGLE_ARB, | 87 context3d->texImageIOSurface2DCHROMIUM(GL_TEXTURE_RECTANGLE_ARB, |
| 101 io_surface_size_.width(), | 88 io_surface_size_.width(), |
| 102 io_surface_size_.height(), | 89 io_surface_size_.height(), |
| 103 io_surface_id_, | 90 io_surface_id_, |
| 104 0); | 91 0); |
| 105 // Do not check for error conditions. texImageIOSurface2DCHROMIUM() is | 92 // Do not check for error conditions. texImageIOSurface2DCHROMIUM() is |
| 106 // supposed to hold on to the last good IOSurface if the new one is already | 93 // supposed to hold on to the last good IOSurface if the new one is already |
| 107 // closed. This is only a possibility during live resizing of plugins. | 94 // closed. This is only a possibility during live resizing of plugins. |
| 108 // However, it seems that this is not sufficient to completely guard against | 95 // However, it seems that this is not sufficient to completely guard against |
| 109 // garbage being drawn. If this is found to be a significant issue, it may | 96 // garbage being drawn. If this is found to be a significant issue, it may |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 | 142 |
| 156 io_surface_id_ = io_surface_id; | 143 io_surface_id_ = io_surface_id; |
| 157 io_surface_size_ = size; | 144 io_surface_size_ = size; |
| 158 } | 145 } |
| 159 | 146 |
| 160 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { | 147 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { |
| 161 return "IOSurfaceLayer"; | 148 return "IOSurfaceLayer"; |
| 162 } | 149 } |
| 163 | 150 |
| 164 } // namespace cc | 151 } // namespace cc |
| OLD | NEW |