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 "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/output/gl_renderer.h" | 9 #include "cc/output/gl_renderer.h" |
10 #include "cc/resources/resource_provider.h" | 10 #include "cc/resources/resource_provider.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 DCHECK(mailbox.IsZero()); | 183 DCHECK(mailbox.IsZero()); |
184 | 184 |
185 if (!software_compositor) { | 185 if (!software_compositor) { |
186 DCHECK(context_provider_); | 186 DCHECK(context_provider_); |
187 | 187 |
188 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 188 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
189 | 189 |
190 GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name)); | 190 GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name)); |
191 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, | 191 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, |
192 resource_id); | 192 resource_id); |
193 GLC(gl, gl->BindTexture(GL_TEXTURE_2D, lock.texture_id())); | 193 GLC(gl, |
194 GLC(gl, gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name)); | 194 gl->ProduceTextureDirectCHROMIUM( |
195 GLC(gl, gl->BindTexture(GL_TEXTURE_2D, 0)); | 195 lock.texture_id(), GL_TEXTURE_2D, mailbox.name)); |
196 } | 196 } |
197 | 197 |
198 if (resource_id) | 198 if (resource_id) |
199 all_resources_.push_back(resource_id); | 199 all_resources_.push_back(resource_id); |
200 } | 200 } |
201 | 201 |
202 if (resource_id == 0) { | 202 if (resource_id == 0) { |
203 allocation_success = false; | 203 allocation_success = false; |
204 break; | 204 break; |
205 } | 205 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 361 } |
362 | 362 |
363 PlaneResource recycled_resource(data.resource_id, | 363 PlaneResource recycled_resource(data.resource_id, |
364 data.resource_size, | 364 data.resource_size, |
365 data.resource_format, | 365 data.resource_format, |
366 data.mailbox); | 366 data.mailbox); |
367 updater->recycled_resources_.push_back(recycled_resource); | 367 updater->recycled_resources_.push_back(recycled_resource); |
368 } | 368 } |
369 | 369 |
370 } // namespace cc | 370 } // namespace cc |
OLD | NEW |