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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if (m_tilingOption == NeverTile && m_tiler->numTiles() > 1) | 131 if (m_tilingOption == NeverTile && m_tiler->numTiles() > 1) |
132 return false; | 132 return false; |
133 | 133 |
134 return !m_skipsDraw; | 134 return !m_skipsDraw; |
135 } | 135 } |
136 | 136 |
137 void TiledLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) | 137 void TiledLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) |
138 { | 138 { |
139 LayerChromium::setLayerTreeHost(host); | 139 LayerChromium::setLayerTreeHost(host); |
140 | 140 |
141 if (m_tiler) | 141 if (m_tiler || !host) |
142 return; | 142 return; |
143 | 143 |
144 createTextureUpdater(host); | 144 createTextureUpdater(host); |
145 | 145 |
146 m_textureFormat = host->layerRendererCapabilities().bestTextureFormat; | 146 m_textureFormat = host->layerRendererCapabilities().bestTextureFormat; |
147 m_textureOrientation = textureUpdater()->orientation(); | 147 m_textureOrientation = textureUpdater()->orientation(); |
148 m_sampledTexelFormat = textureUpdater()->sampledTexelFormat(m_textureFormat)
; | 148 m_sampledTexelFormat = textureUpdater()->sampledTexelFormat(m_textureFormat)
; |
149 m_tiler = CCLayerTilingData::create( | 149 m_tiler = CCLayerTilingData::create( |
150 IntSize(defaultTileSize, defaultTileSize), | 150 IntSize(defaultTileSize, defaultTileSize), |
151 isRootLayer() ? CCLayerTilingData::NoBorderTexels : CCLayerTilingData::H
asBorderTexels); | 151 isRootLayer() ? CCLayerTilingData::NoBorderTexels : CCLayerTilingData::H
asBorderTexels); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 426 |
427 m_paintRect = m_tiler->layerRectToContentRect(dirtyLayerRect); | 427 m_paintRect = m_tiler->layerRectToContentRect(dirtyLayerRect); |
428 if (dirtyLayerRect.isEmpty()) | 428 if (dirtyLayerRect.isEmpty()) |
429 return; | 429 return; |
430 | 430 |
431 textureUpdater()->prepareToUpdate(m_paintRect, m_tiler->tileSize(), m_tiler-
>hasBorderTexels()); | 431 textureUpdater()->prepareToUpdate(m_paintRect, m_tiler->tileSize(), m_tiler-
>hasBorderTexels()); |
432 } | 432 } |
433 | 433 |
434 } | 434 } |
435 #endif // USE(ACCELERATED_COMPOSITING) | 435 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |