| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 | 8 |
| 9 #include "TiledLayerChromium.h" | 9 #include "TiledLayerChromium.h" |
| 10 | 10 |
| 11 #include "CCLayerImpl.h" | 11 #include "CCLayerImpl.h" |
| 12 #include "CCLayerTreeHost.h" | 12 #include "CCLayerTreeHost.h" |
| 13 #include "CCOverdrawMetrics.h" | 13 #include "CCOverdrawMetrics.h" |
| 14 #include "CCTextureUpdateQueue.h" | 14 #include "CCTextureUpdateQueue.h" |
| 15 #include "CCTiledLayerImpl.h" | 15 #include "CCTiledLayerImpl.h" |
| 16 #include "GraphicsContext3D.h" | 16 #include "GraphicsContext3D.h" |
| 17 #include "Region.h" | 17 #include "Region.h" |
| 18 #include <wtf/CurrentTime.h> | 18 #include <wtf/CurrentTime.h> |
| 19 #include <wtf/MathExtras.h> | 19 #include <wtf/MathExtras.h> |
| 20 | 20 |
| 21 using namespace std; | 21 using namespace std; |
| 22 using WebKit::WebTransformationMatrix; | 22 using WebKit::WebTransformationMatrix; |
| 23 | 23 |
| 24 namespace WebCore { | 24 namespace cc { |
| 25 | 25 |
| 26 class UpdatableTile : public CCLayerTilingData::Tile { | 26 class UpdatableTile : public CCLayerTilingData::Tile { |
| 27 WTF_MAKE_NONCOPYABLE(UpdatableTile); | 27 WTF_MAKE_NONCOPYABLE(UpdatableTile); |
| 28 public: | 28 public: |
| 29 static PassOwnPtr<UpdatableTile> create(PassOwnPtr<LayerTextureUpdater::Text
ure> texture) | 29 static PassOwnPtr<UpdatableTile> create(PassOwnPtr<LayerTextureUpdater::Text
ure> texture) |
| 30 { | 30 { |
| 31 return adoptPtr(new UpdatableTile(texture)); | 31 return adoptPtr(new UpdatableTile(texture)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 LayerTextureUpdater::Texture* texture() { return m_texture.get(); } | 34 LayerTextureUpdater::Texture* texture() { return m_texture.get(); } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 IntSize oldBounds = m_tiler->bounds(); | 137 IntSize oldBounds = m_tiler->bounds(); |
| 138 IntSize newBounds = contentBounds(); | 138 IntSize newBounds = contentBounds(); |
| 139 if (oldBounds == newBounds) | 139 if (oldBounds == newBounds) |
| 140 return; | 140 return; |
| 141 m_tiler->setBounds(newBounds); | 141 m_tiler->setBounds(newBounds); |
| 142 | 142 |
| 143 // Invalidate any areas that the new bounds exposes. | 143 // Invalidate any areas that the new bounds exposes. |
| 144 Region oldRegion(IntRect(IntPoint(), oldBounds)); | 144 Region oldRegion(IntRect(IntPoint(), oldBounds)); |
| 145 Region newRegion(IntRect(IntPoint(), newBounds)); | 145 Region newRegion(IntRect(IntPoint(), newBounds)); |
| 146 newRegion.subtract(oldRegion); | 146 newRegion.subtract(oldRegion); |
| 147 Vector<IntRect> rects = newRegion.rects(); | 147 Vector<WebCore::IntRect> rects = newRegion.rects(); |
| 148 for (size_t i = 0; i < rects.size(); ++i) | 148 for (size_t i = 0; i < rects.size(); ++i) |
| 149 invalidateContentRect(rects[i]); | 149 invalidateContentRect(rects[i]); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void TiledLayerChromium::setTileSize(const IntSize& size) | 152 void TiledLayerChromium::setTileSize(const IntSize& size) |
| 153 { | 153 { |
| 154 m_tiler->setTileSize(size); | 154 m_tiler->setTileSize(size); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void TiledLayerChromium::setBorderTexelOption(CCLayerTilingData::BorderTexelOpti
on borderTexelOption) | 157 void TiledLayerChromium::setBorderTexelOption(CCLayerTilingData::BorderTexelOpti
on borderTexelOption) |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 prepaintRect.inflateX(m_tiler->tileSize().width()); | 781 prepaintRect.inflateX(m_tiler->tileSize().width()); |
| 782 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); | 782 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); |
| 783 IntRect contentRect(IntPoint::zero(), contentBounds()); | 783 IntRect contentRect(IntPoint::zero(), contentBounds()); |
| 784 prepaintRect.intersect(contentRect); | 784 prepaintRect.intersect(contentRect); |
| 785 | 785 |
| 786 return prepaintRect; | 786 return prepaintRect; |
| 787 } | 787 } |
| 788 | 788 |
| 789 } | 789 } |
| 790 #endif // USE(ACCELERATED_COMPOSITING) | 790 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |