| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 m_context->makeContextCurrent(); | 159 m_context->makeContextCurrent(); |
| 160 if (settings().acceleratePainting) { | 160 if (settings().acceleratePainting) { |
| 161 m_capabilities.usingAcceleratedPainting = true; | 161 m_capabilities.usingAcceleratedPainting = true; |
| 162 } | 162 } |
| 163 | 163 |
| 164 WebCore::Extensions3D* extensions = m_context->getExtensions(); | 164 WebCore::Extensions3D* extensions = m_context->getExtensions(); |
| 165 m_capabilities.usingMapSub = extensions->supports("GL_CHROMIUM_map_sub"); | 165 m_capabilities.usingMapSub = extensions->supports("GL_CHROMIUM_map_sub"); |
| 166 if (m_capabilities.usingMapSub) | 166 if (m_capabilities.usingMapSub) |
| 167 extensions->ensureEnabled("GL_CHROMIUM_map_sub"); | 167 extensions->ensureEnabled("GL_CHROMIUM_map_sub"); |
| 168 | 168 |
| 169 m_capabilities.usingSetVisibility = extensions->supports("GL_CHROMIUM_set_vi
sibility"); |
| 170 if (m_capabilities.usingSetVisibility) |
| 171 extensions->ensureEnabled("GL_CHROMIUM_set_visibility"); |
| 172 |
| 169 GLC(m_context.get(), m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_S
IZE, &m_capabilities.maxTextureSize)); | 173 GLC(m_context.get(), m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_S
IZE, &m_capabilities.maxTextureSize)); |
| 170 m_capabilities.bestTextureFormat = PlatformColor::bestTextureFormat(m_contex
t.get()); | 174 m_capabilities.bestTextureFormat = PlatformColor::bestTextureFormat(m_contex
t.get()); |
| 171 | 175 |
| 172 if (!initializeSharedObjects()) | 176 if (!initializeSharedObjects()) |
| 173 return false; | 177 return false; |
| 174 | 178 |
| 175 m_headsUpDisplay = CCHeadsUpDisplay::create(this); | 179 m_headsUpDisplay = CCHeadsUpDisplay::create(this); |
| 176 | 180 |
| 177 // Make sure the viewport and context gets initialized, even if it is to zer
o. | 181 // Make sure the viewport and context gets initialized, even if it is to zer
o. |
| 178 viewportChanged(); | 182 viewportChanged(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 205 return m_context.get(); | 209 return m_context.get(); |
| 206 } | 210 } |
| 207 | 211 |
| 208 void LayerRendererChromium::debugGLCall(GraphicsContext3D* context, const char*
command, const char* file, int line) | 212 void LayerRendererChromium::debugGLCall(GraphicsContext3D* context, const char*
command, const char* file, int line) |
| 209 { | 213 { |
| 210 unsigned long error = context->getError(); | 214 unsigned long error = context->getError(); |
| 211 if (error != GraphicsContext3D::NO_ERROR) | 215 if (error != GraphicsContext3D::NO_ERROR) |
| 212 LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error
%x\n", file, line, command, static_cast<int>(error)); | 216 LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error
%x\n", file, line, command, static_cast<int>(error)); |
| 213 } | 217 } |
| 214 | 218 |
| 219 void LayerRendererChromium::setVisible(bool visible) |
| 220 { |
| 221 if (!visible) |
| 222 releaseRenderSurfaceTextures(); |
| 223 if (m_capabilities.usingSetVisibility) { |
| 224 Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChr
omium*>(m_context->getExtensions()); |
| 225 extensions3DChromium->setVisibilityCHROMIUM(visible); |
| 226 } |
| 227 } |
| 228 |
| 215 void LayerRendererChromium::releaseRenderSurfaceTextures() | 229 void LayerRendererChromium::releaseRenderSurfaceTextures() |
| 216 { | 230 { |
| 217 m_renderSurfaceTextureManager->evictAndDeleteAllTextures(m_renderSurfaceText
ureAllocator.get()); | 231 m_renderSurfaceTextureManager->evictAndDeleteAllTextures(m_renderSurfaceText
ureAllocator.get()); |
| 218 } | 232 } |
| 219 | 233 |
| 220 void LayerRendererChromium::viewportChanged() | 234 void LayerRendererChromium::viewportChanged() |
| 221 { | 235 { |
| 222 if (m_context) | 236 if (m_context) |
| 223 m_context->reshape(std::max(1, viewportWidth()), std::max(1, viewportHei
ght())); | 237 m_context->reshape(std::max(1, viewportWidth()), std::max(1, viewportHei
ght())); |
| 224 | 238 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 } | 879 } |
| 866 | 880 |
| 867 bool LayerRendererChromium::isContextLost() | 881 bool LayerRendererChromium::isContextLost() |
| 868 { | 882 { |
| 869 return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != Gra
phicsContext3D::NO_ERROR); | 883 return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != Gra
phicsContext3D::NO_ERROR); |
| 870 } | 884 } |
| 871 | 885 |
| 872 } // namespace WebCore | 886 } // namespace WebCore |
| 873 | 887 |
| 874 #endif // USE(ACCELERATED_COMPOSITING) | 888 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |