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; | |
89 bool has_egl_image = true; | 88 bool has_egl_image = true; |
90 for (size_t i = 0; i < extensions.size(); ++i) { | 89 for (size_t i = 0; i < extensions.size(); ++i) { |
91 if (extensions[i] == "GL_EXT_read_format_bgra") | 90 if (extensions[i] == "GL_EXT_read_format_bgra") |
92 has_read_bgra = true; | 91 has_read_bgra = true; |
93 else if (extensions[i] == "GL_CHROMIUM_set_visibility") | 92 else if (extensions[i] == "GL_CHROMIUM_set_visibility") |
94 has_set_visibility = true; | 93 has_set_visibility = true; |
95 else if (extensions[i] == "GL_CHROMIUM_iosurface") | 94 else if (extensions[i] == "GL_CHROMIUM_iosurface") |
96 has_io_surface = true; | 95 has_io_surface = true; |
97 else if (extensions[i] == "GL_ARB_texture_rectangle") | 96 else if (extensions[i] == "GL_ARB_texture_rectangle") |
98 has_arb_texture_rect = true; | 97 has_arb_texture_rect = true; |
99 else if (extensions[i] == "GL_CHROMIUM_gpu_memory_manager") | |
100 has_gpu_memory_manager = true; | |
101 else if (extensions[i] == "GL_OES_EGL_image_external") | 98 else if (extensions[i] == "GL_OES_EGL_image_external") |
102 has_egl_image = true; | 99 has_egl_image = true; |
103 } | 100 } |
104 | 101 |
105 if (has_io_surface) | 102 if (has_io_surface) |
106 DCHECK(has_arb_texture_rect); | 103 DCHECK(has_arb_texture_rect); |
107 | 104 |
108 capabilities_.using_accelerated_painting = | 105 capabilities_.using_accelerated_painting = |
109 Settings().accelerate_painting && | 106 Settings().accelerate_painting && |
110 capabilities_.best_texture_format == GL_BGRA_EXT && | 107 capabilities_.best_texture_format == GL_BGRA_EXT && |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 187 |
191 void DelegatingRenderer::SetVisible(bool visible) { | 188 void DelegatingRenderer::SetVisible(bool visible) { |
192 visible_ = visible; | 189 visible_ = visible; |
193 } | 190 } |
194 | 191 |
195 void DelegatingRenderer::onContextLost() { | 192 void DelegatingRenderer::onContextLost() { |
196 client_->DidLoseOutputSurface(); | 193 client_->DidLoseOutputSurface(); |
197 } | 194 } |
198 | 195 |
199 } // namespace cc | 196 } // namespace cc |
OLD | NEW |