| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 resource_provider_->CreateResource(output_plane_resource_size, | 196 resource_provider_->CreateResource(output_plane_resource_size, |
| 197 GL_CLAMP_TO_EDGE, | 197 GL_CLAMP_TO_EDGE, |
| 198 ResourceProvider::TextureUsageAny, | 198 ResourceProvider::TextureUsageAny, |
| 199 output_resource_format); | 199 output_resource_format); |
| 200 | 200 |
| 201 DCHECK(mailbox.IsZero()); | 201 DCHECK(mailbox.IsZero()); |
| 202 | 202 |
| 203 if (!software_compositor) { | 203 if (!software_compositor) { |
| 204 DCHECK(context_provider_); | 204 DCHECK(context_provider_); |
| 205 | 205 |
| 206 WebKit::WebGraphicsContext3D* context = | 206 blink::WebGraphicsContext3D* context = |
| 207 context_provider_->Context3d(); | 207 context_provider_->Context3d(); |
| 208 | 208 |
| 209 GLC(context, context->genMailboxCHROMIUM(mailbox.name)); | 209 GLC(context, context->genMailboxCHROMIUM(mailbox.name)); |
| 210 if (mailbox.IsZero()) { | 210 if (mailbox.IsZero()) { |
| 211 resource_provider_->DeleteResource(resource_id); | 211 resource_provider_->DeleteResource(resource_id); |
| 212 resource_id = 0; | 212 resource_id = 0; |
| 213 } else { | 213 } else { |
| 214 ResourceProvider::ScopedWriteLockGL lock( | 214 ResourceProvider::ScopedWriteLockGL lock( |
| 215 resource_provider_, resource_id); | 215 resource_provider_, resource_id); |
| 216 GLC(context, context->bindTexture(GL_TEXTURE_2D, lock.texture_id())); | 216 GLC(context, context->bindTexture(GL_TEXTURE_2D, lock.texture_id())); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 400 } |
| 401 | 401 |
| 402 PlaneResource recycled_resource(data.resource_id, | 402 PlaneResource recycled_resource(data.resource_id, |
| 403 data.resource_size, | 403 data.resource_size, |
| 404 data.resource_format, | 404 data.resource_format, |
| 405 data.mailbox); | 405 data.mailbox); |
| 406 updater->recycled_resources_.push_back(recycled_resource); | 406 updater->recycled_resources_.push_back(recycled_resource); |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace cc | 409 } // namespace cc |
| OLD | NEW |