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 "base/basictypes.h" |
9 #include "TiledLayerChromium.h" | 10 #include "TiledLayerChromium.h" |
10 | 11 |
11 #include "CCLayerImpl.h" | 12 #include "CCLayerImpl.h" |
12 #include "CCLayerTreeHost.h" | 13 #include "CCLayerTreeHost.h" |
13 #include "CCOverdrawMetrics.h" | 14 #include "CCOverdrawMetrics.h" |
14 #include "CCTextureUpdateQueue.h" | 15 #include "CCTextureUpdateQueue.h" |
15 #include "CCTiledLayerImpl.h" | 16 #include "CCTiledLayerImpl.h" |
16 #include "GraphicsContext3D.h" | 17 #include "GraphicsContext3D.h" |
17 #include "Region.h" | 18 #include "Region.h" |
18 #include <wtf/CurrentTime.h> | 19 #include <wtf/CurrentTime.h> |
19 #include <wtf/MathExtras.h> | 20 #include <wtf/MathExtras.h> |
20 | 21 |
21 using namespace std; | 22 using namespace std; |
22 using WebKit::WebTransformationMatrix; | 23 using WebKit::WebTransformationMatrix; |
23 | 24 |
24 namespace cc { | 25 namespace cc { |
25 | 26 |
26 class UpdatableTile : public CCLayerTilingData::Tile { | 27 class UpdatableTile : public CCLayerTilingData::Tile { |
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(); } |
35 CCPrioritizedTexture* managedTexture() { return m_texture->texture(); } | 35 CCPrioritizedTexture* managedTexture() { return m_texture->texture(); } |
36 | 36 |
37 bool isDirty() const { return !dirtyRect.isEmpty(); } | 37 bool isDirty() const { return !dirtyRect.isEmpty(); } |
(...skipping 30 matching lines...) Expand all Loading... |
68 explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture) | 68 explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture) |
69 : partialUpdate(false) | 69 : partialUpdate(false) |
70 , validForFrame(false) | 70 , validForFrame(false) |
71 , occluded(false) | 71 , occluded(false) |
72 , isInUseOnImpl(false) | 72 , isInUseOnImpl(false) |
73 , m_texture(texture) | 73 , m_texture(texture) |
74 { | 74 { |
75 } | 75 } |
76 | 76 |
77 OwnPtr<LayerTextureUpdater::Texture> m_texture; | 77 OwnPtr<LayerTextureUpdater::Texture> m_texture; |
| 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(UpdatableTile); |
78 }; | 80 }; |
79 | 81 |
80 TiledLayerChromium::TiledLayerChromium() | 82 TiledLayerChromium::TiledLayerChromium() |
81 : LayerChromium() | 83 : LayerChromium() |
82 , m_textureFormat(GraphicsContext3D::INVALID_ENUM) | 84 , m_textureFormat(GraphicsContext3D::INVALID_ENUM) |
83 , m_skipsDraw(false) | 85 , m_skipsDraw(false) |
84 , m_failedUpdate(false) | 86 , m_failedUpdate(false) |
85 , m_sampledTexelFormat(LayerTextureUpdater::SampledTexelFormatInvalid) | 87 , m_sampledTexelFormat(LayerTextureUpdater::SampledTexelFormatInvalid) |
86 , m_tilingOption(AutoTile) | 88 , m_tilingOption(AutoTile) |
87 { | 89 { |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 prepaintRect.inflateX(m_tiler->tileSize().width()); | 804 prepaintRect.inflateX(m_tiler->tileSize().width()); |
803 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); | 805 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); |
804 IntRect contentRect(IntPoint::zero(), contentBounds()); | 806 IntRect contentRect(IntPoint::zero(), contentBounds()); |
805 prepaintRect.intersect(contentRect); | 807 prepaintRect.intersect(contentRect); |
806 | 808 |
807 return prepaintRect; | 809 return prepaintRect; |
808 } | 810 } |
809 | 811 |
810 } | 812 } |
811 #endif // USE(ACCELERATED_COMPOSITING) | 813 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |