| 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/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "cc/output/output_surface.h" | 8 #include "cc/output/output_surface.h" |
| 9 #include "cc/quads/io_surface_draw_quad.h" | 9 #include "cc/quads/io_surface_draw_quad.h" |
| 10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 void IOSurfaceLayerImpl::DestroyResource() { | 25 void IOSurfaceLayerImpl::DestroyResource() { |
| 26 if (io_surface_resource_id_) { | 26 if (io_surface_resource_id_) { |
| 27 ResourceProvider* resource_provider = | 27 ResourceProvider* resource_provider = |
| 28 layer_tree_impl()->resource_provider(); | 28 layer_tree_impl()->resource_provider(); |
| 29 resource_provider->DeleteResource(io_surface_resource_id_); | 29 resource_provider->DeleteResource(io_surface_resource_id_); |
| 30 io_surface_resource_id_ = 0; | 30 io_surface_resource_id_ = 0; |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 scoped_ptr<LayerImpl> IOSurfaceLayerImpl::CreateLayerImpl( | 34 std::unique_ptr<LayerImpl> IOSurfaceLayerImpl::CreateLayerImpl( |
| 35 LayerTreeImpl* tree_impl) { | 35 LayerTreeImpl* tree_impl) { |
| 36 return IOSurfaceLayerImpl::Create(tree_impl, id()); | 36 return IOSurfaceLayerImpl::Create(tree_impl, id()); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void IOSurfaceLayerImpl::PushPropertiesTo(LayerImpl* layer) { | 39 void IOSurfaceLayerImpl::PushPropertiesTo(LayerImpl* layer) { |
| 40 LayerImpl::PushPropertiesTo(layer); | 40 LayerImpl::PushPropertiesTo(layer); |
| 41 | 41 |
| 42 IOSurfaceLayerImpl* io_surface_layer = | 42 IOSurfaceLayerImpl* io_surface_layer = |
| 43 static_cast<IOSurfaceLayerImpl*>(layer); | 43 static_cast<IOSurfaceLayerImpl*>(layer); |
| 44 io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_); | 44 io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 io_surface_id_ = io_surface_id; | 100 io_surface_id_ = io_surface_id; |
| 101 io_surface_size_ = size; | 101 io_surface_size_ = size; |
| 102 } | 102 } |
| 103 | 103 |
| 104 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { | 104 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { |
| 105 return "cc::IOSurfaceLayerImpl"; | 105 return "cc::IOSurfaceLayerImpl"; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace cc | 108 } // namespace cc |
| OLD | NEW |