| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/output/gl_renderer.h" | 8 #include "cc/output/gl_renderer.h" |
| 9 #include "cc/resources/resource_provider.h" | 9 #include "cc/resources/resource_provider.h" |
| 10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 DCHECK(mailbox.IsZero()); | 181 DCHECK(mailbox.IsZero()); |
| 182 | 182 |
| 183 if (!software_compositor) { | 183 if (!software_compositor) { |
| 184 DCHECK(context_provider_); | 184 DCHECK(context_provider_); |
| 185 | 185 |
| 186 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 186 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
| 187 | 187 |
| 188 GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name)); | 188 GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name)); |
| 189 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, | 189 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, |
| 190 resource_id); | 190 resource_id); |
| 191 GLC(gl, gl->BindTexture(GL_TEXTURE_2D, lock.texture_id())); | 191 GLC(gl, |
| 192 GLC(gl, gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name)); | 192 gl->ProduceTextureDirectCHROMIUM( |
| 193 GLC(gl, gl->BindTexture(GL_TEXTURE_2D, 0)); | 193 lock.texture_id(), GL_TEXTURE_2D, mailbox.name)); |
| 194 } | 194 } |
| 195 | 195 |
| 196 if (resource_id) | 196 if (resource_id) |
| 197 all_resources_.push_back(resource_id); | 197 all_resources_.push_back(resource_id); |
| 198 } | 198 } |
| 199 | 199 |
| 200 if (resource_id == 0) { | 200 if (resource_id == 0) { |
| 201 allocation_success = false; | 201 allocation_success = false; |
| 202 break; | 202 break; |
| 203 } | 203 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 PlaneResource recycled_resource(data.resource_id, | 360 PlaneResource recycled_resource(data.resource_id, |
| 361 data.resource_size, | 361 data.resource_size, |
| 362 data.resource_format, | 362 data.resource_format, |
| 363 data.mailbox); | 363 data.mailbox); |
| 364 updater->recycled_resources_.push_back(recycled_resource); | 364 updater->recycled_resources_.push_back(recycled_resource); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace cc | 367 } // namespace cc |
| OLD | NEW |