| 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/layers/quad_sink.h" | 8 #include "cc/layers/quad_sink.h" |
| 9 #include "cc/output/gl_renderer.h" // For the GLC() macro. | 9 #include "cc/output/gl_renderer.h" // For the GLC() macro. |
| 10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return false; | 68 return false; |
| 69 | 69 |
| 70 if (io_surface_changed_) { | 70 if (io_surface_changed_) { |
| 71 ContextProvider* context_provider = | 71 ContextProvider* context_provider = |
| 72 layer_tree_impl()->output_surface()->context_provider().get(); | 72 layer_tree_impl()->output_surface()->context_provider().get(); |
| 73 if (!context_provider) { | 73 if (!context_provider) { |
| 74 // TODO(skaslev): Implement this path for software compositing. | 74 // TODO(skaslev): Implement this path for software compositing. |
| 75 return false; | 75 return false; |
| 76 } | 76 } |
| 77 | 77 |
| 78 WebKit::WebGraphicsContext3D* context3d = context_provider->Context3d(); | 78 blink::WebGraphicsContext3D* context3d = context_provider->Context3d(); |
| 79 | 79 |
| 80 // TODO(ernstm): Do this in a way that we can track memory usage. | 80 // TODO(ernstm): Do this in a way that we can track memory usage. |
| 81 if (!io_surface_texture_id_) { | 81 if (!io_surface_texture_id_) { |
| 82 io_surface_texture_id_ = context3d->createTexture(); | 82 io_surface_texture_id_ = context3d->createTexture(); |
| 83 io_surface_resource_id_ = | 83 io_surface_resource_id_ = |
| 84 resource_provider->CreateResourceFromExternalTexture( | 84 resource_provider->CreateResourceFromExternalTexture( |
| 85 GL_TEXTURE_RECTANGLE_ARB, | 85 GL_TEXTURE_RECTANGLE_ARB, |
| 86 io_surface_texture_id_); | 86 io_surface_texture_id_); |
| 87 } | 87 } |
| 88 | 88 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 io_surface_id_ = io_surface_id; | 140 io_surface_id_ = io_surface_id; |
| 141 io_surface_size_ = size; | 141 io_surface_size_ = size; |
| 142 } | 142 } |
| 143 | 143 |
| 144 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { | 144 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { |
| 145 return "cc::IOSurfaceLayerImpl"; | 145 return "cc::IOSurfaceLayerImpl"; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace cc | 148 } // namespace cc |
| OLD | NEW |