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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1066 |
1067 GLC(m_context, m_context->drawElements(GraphicsContext3D::TRIANGLES, 6, Grap
hicsContext3D::UNSIGNED_SHORT, 0)); | 1067 GLC(m_context, m_context->drawElements(GraphicsContext3D::TRIANGLES, 6, Grap
hicsContext3D::UNSIGNED_SHORT, 0)); |
1068 } | 1068 } |
1069 | 1069 |
1070 void LayerRendererChromium::finish() | 1070 void LayerRendererChromium::finish() |
1071 { | 1071 { |
1072 TRACE_EVENT("LayerRendererChromium::finish", this, 0); | 1072 TRACE_EVENT("LayerRendererChromium::finish", this, 0); |
1073 m_context->finish(); | 1073 m_context->finish(); |
1074 } | 1074 } |
1075 | 1075 |
1076 void LayerRendererChromium::swapBuffers(const IntRect& subBuffer) | 1076 bool LayerRendererChromium::swapBuffers(const IntRect& subBuffer) |
1077 { | 1077 { |
1078 // FIXME: Remove this once gpu process supports ignoring swap buffers comman
d while framebuffer is discarded. | 1078 // FIXME: Remove this once gpu process supports ignoring swap buffers comman
d while framebuffer is discarded. |
1079 // Alternatively (preferably?), protect all cc code so as not to atte
mpt a swap after a framebuffer discard. | 1079 // Alternatively (preferably?), protect all cc code so as not to atte
mpt a swap after a framebuffer discard. |
1080 if (m_isFramebufferDiscarded) { | 1080 if (m_isFramebufferDiscarded) { |
1081 m_client->setFullRootLayerDamage(); | 1081 m_client->setFullRootLayerDamage(); |
1082 return; | 1082 return false; |
1083 } | 1083 } |
1084 | 1084 |
1085 TRACE_EVENT("LayerRendererChromium::swapBuffers", this, 0); | 1085 TRACE_EVENT("LayerRendererChromium::swapBuffers", this, 0); |
1086 // We're done! Time to swapbuffers! | 1086 // We're done! Time to swapbuffers! |
1087 | 1087 |
1088 if (m_capabilities.usingPartialSwap) { | 1088 if (m_capabilities.usingPartialSwap) { |
1089 // If supported, we can save significant bandwidth by only swapping the
damaged/scissored region (clamped to the viewport) | 1089 // If supported, we can save significant bandwidth by only swapping the
damaged/scissored region (clamped to the viewport) |
1090 IntRect clippedSubBuffer = subBuffer; | 1090 IntRect clippedSubBuffer = subBuffer; |
1091 clippedSubBuffer.intersect(IntRect(IntPoint::zero(), viewportSize())); | 1091 clippedSubBuffer.intersect(IntRect(IntPoint::zero(), viewportSize())); |
1092 Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChr
omium*>(m_context->getExtensions()); | 1092 Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChr
omium*>(m_context->getExtensions()); |
1093 int flippedYPosOfRectBottom = viewportHeight() - clippedSubBuffer.y() -
clippedSubBuffer.height(); | 1093 int flippedYPosOfRectBottom = viewportHeight() - clippedSubBuffer.y() -
clippedSubBuffer.height(); |
1094 extensions3DChromium->postSubBufferCHROMIUM(clippedSubBuffer.x(), flippe
dYPosOfRectBottom, clippedSubBuffer.width(), clippedSubBuffer.height()); | 1094 extensions3DChromium->postSubBufferCHROMIUM(clippedSubBuffer.x(), flippe
dYPosOfRectBottom, clippedSubBuffer.width(), clippedSubBuffer.height()); |
1095 } else | 1095 } else |
1096 // Note that currently this has the same effect as swapBuffers; we shoul
d | 1096 // Note that currently this has the same effect as swapBuffers; we shoul
d |
1097 // consider exposing a different entry point on GraphicsContext3D. | 1097 // consider exposing a different entry point on GraphicsContext3D. |
1098 m_context->prepareTexture(); | 1098 m_context->prepareTexture(); |
1099 | 1099 |
1100 m_headsUpDisplay->onSwapBuffers(); | 1100 m_headsUpDisplay->onSwapBuffers(); |
| 1101 return true; |
1101 } | 1102 } |
1102 | 1103 |
1103 void LayerRendererChromium::onSwapBuffersComplete() | 1104 void LayerRendererChromium::onSwapBuffersComplete() |
1104 { | 1105 { |
1105 m_client->onSwapBuffersComplete(); | 1106 m_client->onSwapBuffersComplete(); |
1106 } | 1107 } |
1107 | 1108 |
1108 void LayerRendererChromium::discardFramebuffer() | 1109 void LayerRendererChromium::discardFramebuffer() |
1109 { | 1110 { |
1110 if (m_isFramebufferDiscarded) | 1111 if (m_isFramebufferDiscarded) |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 } | 1638 } |
1638 | 1639 |
1639 bool LayerRendererChromium::isContextLost() | 1640 bool LayerRendererChromium::isContextLost() |
1640 { | 1641 { |
1641 return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != Gra
phicsContext3D::NO_ERROR); | 1642 return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != Gra
phicsContext3D::NO_ERROR); |
1642 } | 1643 } |
1643 | 1644 |
1644 } // namespace WebCore | 1645 } // namespace WebCore |
1645 | 1646 |
1646 #endif // USE(ACCELERATED_COMPOSITING) | 1647 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |