| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  242     DCHECK_EQ(plane_resources.size(), 1u); |  242     DCHECK_EQ(plane_resources.size(), 1u); | 
|  243     DCHECK_EQ(plane_resources[0].resource_format, kRGBResourceFormat); |  243     DCHECK_EQ(plane_resources[0].resource_format, kRGBResourceFormat); | 
|  244     DCHECK(plane_resources[0].mailbox.IsZero()); |  244     DCHECK(plane_resources[0].mailbox.IsZero()); | 
|  245  |  245  | 
|  246     if (!video_renderer_) |  246     if (!video_renderer_) | 
|  247       video_renderer_.reset(new media::SkCanvasVideoRenderer); |  247       video_renderer_.reset(new media::SkCanvasVideoRenderer); | 
|  248  |  248  | 
|  249     { |  249     { | 
|  250       ResourceProvider::ScopedWriteLockSoftware lock( |  250       ResourceProvider::ScopedWriteLockSoftware lock( | 
|  251           resource_provider_, plane_resources[0].resource_id); |  251           resource_provider_, plane_resources[0].resource_id); | 
|  252       video_renderer_->Copy(video_frame, lock.sk_canvas()); |  252       SkCanvas canvas(lock.sk_bitmap()); | 
 |  253       video_renderer_->Copy(video_frame, &canvas); | 
|  253     } |  254     } | 
|  254  |  255  | 
|  255     RecycleResourceData recycle_data = { |  256     RecycleResourceData recycle_data = { | 
|  256       plane_resources[0].resource_id, |  257       plane_resources[0].resource_id, | 
|  257       plane_resources[0].resource_size, |  258       plane_resources[0].resource_size, | 
|  258       plane_resources[0].resource_format, |  259       plane_resources[0].resource_format, | 
|  259       gpu::Mailbox() |  260       gpu::Mailbox() | 
|  260     }; |  261     }; | 
|  261     external_resources.software_resources.push_back( |  262     external_resources.software_resources.push_back( | 
|  262         plane_resources[0].resource_id); |  263         plane_resources[0].resource_id); | 
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  390   } |  391   } | 
|  391  |  392  | 
|  392   PlaneResource recycled_resource(data.resource_id, |  393   PlaneResource recycled_resource(data.resource_id, | 
|  393                                   data.resource_size, |  394                                   data.resource_size, | 
|  394                                   data.resource_format, |  395                                   data.resource_format, | 
|  395                                   data.mailbox); |  396                                   data.mailbox); | 
|  396   updater->recycled_resources_.push_back(recycled_resource); |  397   updater->recycled_resources_.push_back(recycled_resource); | 
|  397 } |  398 } | 
|  398  |  399  | 
|  399 }  // namespace cc |  400 }  // namespace cc | 
| OLD | NEW |