| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 context3d->pushGroupMarkerEXT("CompositorContext"); | 73 context3d->pushGroupMarkerEXT("CompositorContext"); |
| 74 | 74 |
| 75 std::string extensions_string = | 75 std::string extensions_string = |
| 76 UTF16ToASCII(context3d->getString(GL_EXTENSIONS)); | 76 UTF16ToASCII(context3d->getString(GL_EXTENSIONS)); |
| 77 | 77 |
| 78 std::vector<std::string> extensions; | 78 std::vector<std::string> extensions; |
| 79 base::SplitString(extensions_string, ' ', &extensions); | 79 base::SplitString(extensions_string, ' ', &extensions); |
| 80 | 80 |
| 81 // TODO(danakj): We need non-GPU-specific paths for these things. This | 81 // TODO(danakj): We need non-GPU-specific paths for these things. This |
| 82 // renderer shouldn't need to use context3d extensions directly. | 82 // renderer shouldn't need to use context3d extensions directly. |
| 83 bool has_read_bgra = false; | |
| 84 bool has_set_visibility = false; | 83 bool has_set_visibility = false; |
| 85 bool has_io_surface = false; | 84 bool has_io_surface = false; |
| 86 bool has_arb_texture_rect = false; | 85 bool has_arb_texture_rect = false; |
| 87 bool has_egl_image = false; | 86 bool has_egl_image = false; |
| 88 bool has_map_image = false; | 87 bool has_map_image = false; |
| 89 for (size_t i = 0; i < extensions.size(); ++i) { | 88 for (size_t i = 0; i < extensions.size(); ++i) { |
| 90 if (extensions[i] == "GL_EXT_read_format_bgra") { | 89 if (extensions[i] == "GL_CHROMIUM_set_visibility") { |
| 91 has_read_bgra = true; | |
| 92 } else if (extensions[i] == "GL_CHROMIUM_set_visibility") { | |
| 93 has_set_visibility = true; | 90 has_set_visibility = true; |
| 94 } else if (extensions[i] == "GL_CHROMIUM_iosurface") { | 91 } else if (extensions[i] == "GL_CHROMIUM_iosurface") { |
| 95 has_io_surface = true; | 92 has_io_surface = true; |
| 96 } else if (extensions[i] == "GL_ARB_texture_rectangle") { | 93 } else if (extensions[i] == "GL_ARB_texture_rectangle") { |
| 97 has_arb_texture_rect = true; | 94 has_arb_texture_rect = true; |
| 98 } else if (extensions[i] == "GL_OES_EGL_image_external") { | 95 } else if (extensions[i] == "GL_OES_EGL_image_external") { |
| 99 has_egl_image = true; | 96 has_egl_image = true; |
| 100 } else if (extensions[i] == "GL_CHROMIUM_map_image") { | 97 } else if (extensions[i] == "GL_CHROMIUM_map_image") { |
| 101 has_map_image = true; | 98 has_map_image = true; |
| 102 } | 99 } |
| 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 = | |
| 109 Settings().accelerate_painting && | |
| 110 capabilities_.best_texture_format == GL_BGRA_EXT && | |
| 111 has_read_bgra; | |
| 112 | |
| 113 // TODO(piman): loop visibility to GPU process? | 105 // TODO(piman): loop visibility to GPU process? |
| 114 capabilities_.using_set_visibility = has_set_visibility; | 106 capabilities_.using_set_visibility = has_set_visibility; |
| 115 | 107 |
| 116 // TODO(danakj): Support GpuMemoryManager. | 108 // TODO(danakj): Support GpuMemoryManager. |
| 117 capabilities_.using_gpu_memory_manager = false; | 109 capabilities_.using_gpu_memory_manager = false; |
| 118 | 110 |
| 119 capabilities_.using_egl_image = has_egl_image; | 111 capabilities_.using_egl_image = has_egl_image; |
| 120 | 112 |
| 121 capabilities_.using_map_image = has_map_image; | 113 capabilities_.using_map_image = has_map_image; |
| 122 | 114 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 if (!context3d) | 178 if (!context3d) |
| 187 return false; | 179 return false; |
| 188 return context3d->getGraphicsResetStatusARB() != GL_NO_ERROR; | 180 return context3d->getGraphicsResetStatusARB() != GL_NO_ERROR; |
| 189 } | 181 } |
| 190 | 182 |
| 191 void DelegatingRenderer::SetVisible(bool visible) { | 183 void DelegatingRenderer::SetVisible(bool visible) { |
| 192 visible_ = visible; | 184 visible_ = visible; |
| 193 } | 185 } |
| 194 | 186 |
| 195 } // namespace cc | 187 } // namespace cc |
| OLD | NEW |