| 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/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 std::vector<std::string> extensions; | 79 std::vector<std::string> extensions; |
| 80 base::SplitString(extensions_string, ' ', &extensions); | 80 base::SplitString(extensions_string, ' ', &extensions); |
| 81 | 81 |
| 82 // TODO(danakj): We need non-GPU-specific paths for these things. This | 82 // TODO(danakj): We need non-GPU-specific paths for these things. This |
| 83 // renderer shouldn't need to use context3d extensions directly. | 83 // renderer shouldn't need to use context3d extensions directly. |
| 84 bool has_read_bgra = true; | 84 bool has_read_bgra = true; |
| 85 bool has_set_visibility = true; | 85 bool has_set_visibility = true; |
| 86 bool has_io_surface = true; | 86 bool has_io_surface = true; |
| 87 bool has_arb_texture_rect = true; | 87 bool has_arb_texture_rect = true; |
| 88 bool has_gpu_memory_manager = true; |
| 88 bool has_egl_image = true; | 89 bool has_egl_image = true; |
| 89 for (size_t i = 0; i < extensions.size(); ++i) { | 90 for (size_t i = 0; i < extensions.size(); ++i) { |
| 90 if (extensions[i] == "GL_EXT_read_format_bgra") | 91 if (extensions[i] == "GL_EXT_read_format_bgra") |
| 91 has_read_bgra = true; | 92 has_read_bgra = true; |
| 92 else if (extensions[i] == "GL_CHROMIUM_set_visibility") | 93 else if (extensions[i] == "GL_CHROMIUM_set_visibility") |
| 93 has_set_visibility = true; | 94 has_set_visibility = true; |
| 94 else if (extensions[i] == "GL_CHROMIUM_iosurface") | 95 else if (extensions[i] == "GL_CHROMIUM_iosurface") |
| 95 has_io_surface = true; | 96 has_io_surface = true; |
| 96 else if (extensions[i] == "GL_ARB_texture_rectangle") | 97 else if (extensions[i] == "GL_ARB_texture_rectangle") |
| 97 has_arb_texture_rect = true; | 98 has_arb_texture_rect = true; |
| 99 else if (extensions[i] == "GL_CHROMIUM_gpu_memory_manager") |
| 100 has_gpu_memory_manager = true; |
| 98 else if (extensions[i] == "GL_OES_EGL_image_external") | 101 else if (extensions[i] == "GL_OES_EGL_image_external") |
| 99 has_egl_image = true; | 102 has_egl_image = true; |
| 100 } | 103 } |
| 101 | 104 |
| 102 if (has_io_surface) | 105 if (has_io_surface) |
| 103 DCHECK(has_arb_texture_rect); | 106 DCHECK(has_arb_texture_rect); |
| 104 | 107 |
| 105 capabilities_.using_accelerated_painting = | 108 capabilities_.using_accelerated_painting = |
| 106 Settings().accelerate_painting && | 109 Settings().accelerate_painting && |
| 107 capabilities_.best_texture_format == GL_BGRA_EXT && | 110 capabilities_.best_texture_format == GL_BGRA_EXT && |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 190 |
| 188 void DelegatingRenderer::SetVisible(bool visible) { | 191 void DelegatingRenderer::SetVisible(bool visible) { |
| 189 visible_ = visible; | 192 visible_ = visible; |
| 190 } | 193 } |
| 191 | 194 |
| 192 void DelegatingRenderer::onContextLost() { | 195 void DelegatingRenderer::onContextLost() { |
| 193 client_->DidLoseOutputSurface(); | 196 client_->DidLoseOutputSurface(); |
| 194 } | 197 } |
| 195 | 198 |
| 196 } // namespace cc | 199 } // namespace cc |
| OLD | NEW |