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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 unsigned long error = context->getError(); | 343 unsigned long error = context->getError(); |
344 if (error != GraphicsContext3D::NO_ERROR) | 344 if (error != GraphicsContext3D::NO_ERROR) |
345 LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error
%x\n", file, line, command, static_cast<int>(error)); | 345 LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error
%x\n", file, line, command, static_cast<int>(error)); |
346 } | 346 } |
347 | 347 |
348 void LayerRendererChromium::setVisible(bool visible) | 348 void LayerRendererChromium::setVisible(bool visible) |
349 { | 349 { |
350 if (!visible) | 350 if (!visible) |
351 releaseRenderSurfaceTextures(); | 351 releaseRenderSurfaceTextures(); |
352 | 352 |
353 // FIXME: Remove this once framebuffer is automatically recreated on first u
se | |
354 if (visible) | |
355 ensureFramebuffer(); | |
356 | |
357 // TODO: Replace setVisibilityCHROMIUM with an extension to explicitly manag
e front/backbuffers | 353 // TODO: Replace setVisibilityCHROMIUM with an extension to explicitly manag
e front/backbuffers |
358 // crbug.com/116049 | 354 // crbug.com/116049 |
359 if (m_capabilities.usingSetVisibility) { | 355 if (m_capabilities.usingSetVisibility) { |
360 Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChr
omium*>(m_context->getExtensions()); | 356 Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChr
omium*>(m_context->getExtensions()); |
361 extensions3DChromium->setVisibilityCHROMIUM(visible); | 357 extensions3DChromium->setVisibilityCHROMIUM(visible); |
362 } | 358 } |
363 } | 359 } |
364 | 360 |
365 void LayerRendererChromium::releaseRenderSurfaceTextures() | 361 void LayerRendererChromium::releaseRenderSurfaceTextures() |
366 { | 362 { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (renderSurface != rootRenderSurface) | 395 if (renderSurface != rootRenderSurface) |
400 #endif | 396 #endif |
401 m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT); | 397 m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT); |
402 | 398 |
403 GLC(m_context.get(), m_context->enable(GraphicsContext3D::SCISSOR_TEST)); | 399 GLC(m_context.get(), m_context->enable(GraphicsContext3D::SCISSOR_TEST)); |
404 } | 400 } |
405 | 401 |
406 void LayerRendererChromium::beginDrawingFrame() | 402 void LayerRendererChromium::beginDrawingFrame() |
407 { | 403 { |
408 ASSERT(rootLayer()); | 404 ASSERT(rootLayer()); |
| 405 |
| 406 // FIXME: Remove this once framebuffer is automatically recreated on first u
se |
| 407 ensureFramebuffer(); |
| 408 |
409 m_defaultRenderSurface = rootLayer()->renderSurface(); | 409 m_defaultRenderSurface = rootLayer()->renderSurface(); |
410 | 410 |
411 // FIXME: use the frame begin time from the overall compositor scheduler. | 411 // FIXME: use the frame begin time from the overall compositor scheduler. |
412 // This value is currently inaccessible because it is up in Chromium's | 412 // This value is currently inaccessible because it is up in Chromium's |
413 // RenderWidget. | 413 // RenderWidget. |
414 m_headsUpDisplay->onFrameBegin(currentTime()); | 414 m_headsUpDisplay->onFrameBegin(currentTime()); |
415 | 415 |
416 size_t contentsMemoryUseBytes = m_contentsTextureAllocator->currentMemoryUse
Bytes(); | 416 size_t contentsMemoryUseBytes = m_contentsTextureAllocator->currentMemoryUse
Bytes(); |
417 size_t maxLimit = TextureManager::highLimitBytes(viewportSize()); | 417 size_t maxLimit = TextureManager::highLimitBytes(viewportSize()); |
418 m_renderSurfaceTextureManager->setMaxMemoryLimitBytes(maxLimit - contentsMem
oryUseBytes); | 418 m_renderSurfaceTextureManager->setMaxMemoryLimitBytes(maxLimit - contentsMem
oryUseBytes); |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 } | 1638 } |
1639 | 1639 |
1640 bool LayerRendererChromium::isContextLost() | 1640 bool LayerRendererChromium::isContextLost() |
1641 { | 1641 { |
1642 return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != Gra
phicsContext3D::NO_ERROR); | 1642 return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != Gra
phicsContext3D::NO_ERROR); |
1643 } | 1643 } |
1644 | 1644 |
1645 } // namespace WebCore | 1645 } // namespace WebCore |
1646 | 1646 |
1647 #endif // USE(ACCELERATED_COMPOSITING) | 1647 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |