| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/gl_renderer.h" | 5 #include "cc/gl_renderer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "cc/damage_tracker.h" | 12 #include "cc/damage_tracker.h" |
| 13 #include "cc/geometry_binding.h" | 13 #include "cc/geometry_binding.h" |
| 14 #include "cc/layer_quad.h" | 14 #include "cc/layer_quad.h" |
| 15 #include "cc/math_util.h" | 15 #include "cc/math_util.h" |
| 16 #include "cc/platform_color.h" | |
| 17 #include "cc/priority_calculator.h" | 16 #include "cc/priority_calculator.h" |
| 18 #include "cc/proxy.h" | 17 #include "cc/proxy.h" |
| 19 #include "cc/render_pass.h" | 18 #include "cc/render_pass.h" |
| 20 #include "cc/render_surface_filters.h" | 19 #include "cc/render_surface_filters.h" |
| 21 #include "cc/scoped_resource.h" | 20 #include "cc/scoped_resource.h" |
| 22 #include "cc/single_thread_proxy.h" | 21 #include "cc/single_thread_proxy.h" |
| 23 #include "cc/stream_video_draw_quad.h" | 22 #include "cc/stream_video_draw_quad.h" |
| 24 #include "cc/texture_draw_quad.h" | 23 #include "cc/texture_draw_quad.h" |
| 25 #include "cc/video_layer_impl.h" | 24 #include "cc/video_layer_impl.h" |
| 26 #include "third_party/khronos/GLES2/gl2.h" | 25 #include "third_party/khronos/GLES2/gl2.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 DCHECK(extensions.count("GL_ARB_texture_rectangle")); | 115 DCHECK(extensions.count("GL_ARB_texture_rectangle")); |
| 117 | 116 |
| 118 m_capabilities.usingGpuMemoryManager = extensions.count("GL_CHROMIUM_gpu_mem
ory_manager"); | 117 m_capabilities.usingGpuMemoryManager = extensions.count("GL_CHROMIUM_gpu_mem
ory_manager"); |
| 119 if (m_capabilities.usingGpuMemoryManager) | 118 if (m_capabilities.usingGpuMemoryManager) |
| 120 m_context->setMemoryAllocationChangedCallbackCHROMIUM(this); | 119 m_context->setMemoryAllocationChangedCallbackCHROMIUM(this); |
| 121 | 120 |
| 122 m_capabilities.usingDiscardFramebuffer = extensions.count("GL_CHROMIUM_disca
rd_framebuffer"); | 121 m_capabilities.usingDiscardFramebuffer = extensions.count("GL_CHROMIUM_disca
rd_framebuffer"); |
| 123 | 122 |
| 124 m_capabilities.usingEglImage = extensions.count("GL_OES_EGL_image_external")
; | 123 m_capabilities.usingEglImage = extensions.count("GL_OES_EGL_image_external")
; |
| 125 | 124 |
| 126 GLC(m_context, m_context->getIntegerv(GL_MAX_TEXTURE_SIZE, &m_capabilities.m
axTextureSize)); | 125 m_capabilities.maxTextureSize = m_resourceProvider->maxTextureSize(); |
| 127 m_capabilities.bestTextureFormat = PlatformColor::bestTextureFormat(m_contex
t, extensions.count("GL_EXT_texture_format_BGRA8888")); | 126 m_capabilities.bestTextureFormat = m_resourceProvider->bestTextureFormat(); |
| 128 | 127 |
| 129 // The updater can access textures while the GLRenderer is using them. | 128 // The updater can access textures while the GLRenderer is using them. |
| 130 m_capabilities.allowPartialTextureUpdates = true; | 129 m_capabilities.allowPartialTextureUpdates = true; |
| 131 | 130 |
| 132 m_isUsingBindUniform = extensions.count("GL_CHROMIUM_bind_uniform_location")
; | 131 m_isUsingBindUniform = extensions.count("GL_CHROMIUM_bind_uniform_location")
; |
| 133 | 132 |
| 134 // Make sure scissoring starts as disabled. | 133 // Make sure scissoring starts as disabled. |
| 135 GLC(m_context, m_context->disable(GL_SCISSOR_TEST)); | 134 GLC(m_context, m_context->disable(GL_SCISSOR_TEST)); |
| 136 DCHECK(!m_isScissorEnabled); | 135 DCHECK(!m_isScissorEnabled); |
| 137 | 136 |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 | 1747 |
| 1749 releaseRenderPassTextures(); | 1748 releaseRenderPassTextures(); |
| 1750 } | 1749 } |
| 1751 | 1750 |
| 1752 bool GLRenderer::isContextLost() | 1751 bool GLRenderer::isContextLost() |
| 1753 { | 1752 { |
| 1754 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1753 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1755 } | 1754 } |
| 1756 | 1755 |
| 1757 } // namespace cc | 1756 } // namespace cc |
| OLD | NEW |