| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 m_layerRenderer->getFramebufferPixels(pixels, rect); | 115 m_layerRenderer->getFramebufferPixels(pixels, rect); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void CCLayerTreeHostImpl::setRootLayer(PassRefPtr<CCLayerImpl> layer) | 118 void CCLayerTreeHostImpl::setRootLayer(PassRefPtr<CCLayerImpl> layer) |
| 119 { | 119 { |
| 120 m_rootLayerImpl = layer; | 120 m_rootLayerImpl = layer; |
| 121 } | 121 } |
| 122 | 122 |
| 123 void CCLayerTreeHostImpl::setVisible(bool visible) | 123 void CCLayerTreeHostImpl::setVisible(bool visible) |
| 124 { | 124 { |
| 125 if (m_layerRenderer && !visible) | 125 if (m_layerRenderer) |
| 126 m_layerRenderer->releaseRenderSurfaceTextures(); | 126 m_layerRenderer->setVisible(visible); |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D>
context) | 129 bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D>
context) |
| 130 { | 130 { |
| 131 OwnPtr<LayerRendererChromium> layerRenderer; | 131 OwnPtr<LayerRendererChromium> layerRenderer; |
| 132 layerRenderer = LayerRendererChromium::create(this, context); | 132 layerRenderer = LayerRendererChromium::create(this, context); |
| 133 | 133 |
| 134 // If creation failed, and we had asked for accelerated painting, disable ac
celerated painting | 134 // If creation failed, and we had asked for accelerated painting, disable ac
celerated painting |
| 135 // and try creating the renderer again. | 135 // and try creating the renderer again. |
| 136 if (!layerRenderer && m_settings.acceleratePainting) { | 136 if (!layerRenderer && m_settings.acceleratePainting) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 info.scrollDelta = rootLayer()->scrollDelta(); | 178 info.scrollDelta = rootLayer()->scrollDelta(); |
| 179 scrollInfo->append(info); | 179 scrollInfo->append(info); |
| 180 | 180 |
| 181 rootLayer()->setScrollPosition(rootLayer()->scrollPosition() + rootLayer
()->scrollDelta()); | 181 rootLayer()->setScrollPosition(rootLayer()->scrollPosition() + rootLayer
()->scrollDelta()); |
| 182 rootLayer()->setScrollDelta(IntSize()); | 182 rootLayer()->setScrollDelta(IntSize()); |
| 183 } | 183 } |
| 184 return scrollInfo.release(); | 184 return scrollInfo.release(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } | 187 } |
| OLD | NEW |