| 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 "cc/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/synchronization/lock.h" | 7 #include "base/synchronization/lock.h" |
| 8 #include "cc/content_layer.h" | 8 #include "cc/content_layer.h" |
| 9 #include "cc/content_layer_client.h" | 9 #include "cc/content_layer_client.h" |
| 10 #include "cc/frame_rate_controller.h" | 10 #include "cc/frame_rate_controller.h" |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 Layer* m_testLayer; | 788 Layer* m_testLayer; |
| 789 }; | 789 }; |
| 790 | 790 |
| 791 class ContentLayerWithUpdateTracking : public ContentLayer { | 791 class ContentLayerWithUpdateTracking : public ContentLayer { |
| 792 public: | 792 public: |
| 793 static scoped_refptr<ContentLayerWithUpdateTracking> create(ContentLayerClie
nt* client) { return make_scoped_refptr(new ContentLayerWithUpdateTracking(clien
t)); } | 793 static scoped_refptr<ContentLayerWithUpdateTracking> create(ContentLayerClie
nt* client) { return make_scoped_refptr(new ContentLayerWithUpdateTracking(clien
t)); } |
| 794 | 794 |
| 795 int paintContentsCount() { return m_paintContentsCount; } | 795 int paintContentsCount() { return m_paintContentsCount; } |
| 796 void resetPaintContentsCount() { m_paintContentsCount = 0; } | 796 void resetPaintContentsCount() { m_paintContentsCount = 0; } |
| 797 | 797 |
| 798 virtual void update(ResourceUpdateQueue& queue, const OcclusionTracker* occl
usion, RenderingStats& stats) OVERRIDE | 798 virtual void update(ResourceUpdateQueue& queue, const OcclusionTracker* occl
usion, RenderingStats* stats) OVERRIDE |
| 799 { | 799 { |
| 800 ContentLayer::update(queue, occlusion, stats); | 800 ContentLayer::update(queue, occlusion, stats); |
| 801 m_paintContentsCount++; | 801 m_paintContentsCount++; |
| 802 } | 802 } |
| 803 | 803 |
| 804 private: | 804 private: |
| 805 explicit ContentLayerWithUpdateTracking(ContentLayerClient* client) | 805 explicit ContentLayerWithUpdateTracking(ContentLayerClient* client) |
| 806 : ContentLayer(client) | 806 : ContentLayer(client) |
| 807 , m_paintContentsCount(0) | 807 , m_paintContentsCount(0) |
| 808 { | 808 { |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 scoped_refptr<ContentLayerWithUpdateTracking> m_surfaceLayer2; | 1470 scoped_refptr<ContentLayerWithUpdateTracking> m_surfaceLayer2; |
| 1471 scoped_refptr<ContentLayerWithUpdateTracking> m_replicaLayer2; | 1471 scoped_refptr<ContentLayerWithUpdateTracking> m_replicaLayer2; |
| 1472 }; | 1472 }; |
| 1473 | 1473 |
| 1474 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSurfaceNotAllocatedForLayersOuts
ideMemoryLimit) | 1474 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSurfaceNotAllocatedForLayersOuts
ideMemoryLimit) |
| 1475 | 1475 |
| 1476 class EvictionTestLayer : public Layer { | 1476 class EvictionTestLayer : public Layer { |
| 1477 public: | 1477 public: |
| 1478 static scoped_refptr<EvictionTestLayer> create() { return make_scoped_refptr
(new EvictionTestLayer()); } | 1478 static scoped_refptr<EvictionTestLayer> create() { return make_scoped_refptr
(new EvictionTestLayer()); } |
| 1479 | 1479 |
| 1480 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering
Stats&) OVERRIDE; | 1480 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering
Stats*) OVERRIDE; |
| 1481 virtual bool drawsContent() const OVERRIDE { return true; } | 1481 virtual bool drawsContent() const OVERRIDE { return true; } |
| 1482 | 1482 |
| 1483 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; | 1483 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; |
| 1484 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; | 1484 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; |
| 1485 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; | 1485 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; |
| 1486 | 1486 |
| 1487 bool haveBackingTexture() const { return m_texture.get() ? m_texture->haveBa
ckingTexture() : false; } | 1487 bool haveBackingTexture() const { return m_texture.get() ? m_texture->haveBa
ckingTexture() : false; } |
| 1488 | 1488 |
| 1489 private: | 1489 private: |
| 1490 EvictionTestLayer() : Layer() { } | 1490 EvictionTestLayer() : Layer() { } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 }; | 1528 }; |
| 1529 | 1529 |
| 1530 void EvictionTestLayer::setTexturePriorities(const PriorityCalculator&) | 1530 void EvictionTestLayer::setTexturePriorities(const PriorityCalculator&) |
| 1531 { | 1531 { |
| 1532 createTextureIfNeeded(); | 1532 createTextureIfNeeded(); |
| 1533 if (!m_texture.get()) | 1533 if (!m_texture.get()) |
| 1534 return; | 1534 return; |
| 1535 m_texture->setRequestPriority(PriorityCalculator::uiPriority(true)); | 1535 m_texture->setRequestPriority(PriorityCalculator::uiPriority(true)); |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 void EvictionTestLayer::update(ResourceUpdateQueue& queue, const OcclusionTracke
r*, RenderingStats&) | 1538 void EvictionTestLayer::update(ResourceUpdateQueue& queue, const OcclusionTracke
r*, RenderingStats*) |
| 1539 { | 1539 { |
| 1540 createTextureIfNeeded(); | 1540 createTextureIfNeeded(); |
| 1541 if (!m_texture.get()) | 1541 if (!m_texture.get()) |
| 1542 return; | 1542 return; |
| 1543 | 1543 |
| 1544 gfx::Rect fullRect(0, 0, 10, 10); | 1544 gfx::Rect fullRect(0, 0, 10, 10); |
| 1545 ResourceUpdate upload = ResourceUpdate::Create( | 1545 ResourceUpdate upload = ResourceUpdate::Create( |
| 1546 m_texture.get(), &m_bitmap, fullRect, fullRect, gfx::Vector2d()); | 1546 m_texture.get(), &m_bitmap, fullRect, fullRect, gfx::Vector2d()); |
| 1547 queue.appendFullUpload(upload); | 1547 queue.appendFullUpload(upload); |
| 1548 } | 1548 } |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 } | 2096 } |
| 2097 | 2097 |
| 2098 TEST_F(LayerTreeHostTestMaxPendingFrames, GLRenderer) | 2098 TEST_F(LayerTreeHostTestMaxPendingFrames, GLRenderer) |
| 2099 { | 2099 { |
| 2100 m_delegatingRenderer = false; | 2100 m_delegatingRenderer = false; |
| 2101 runTest(true); | 2101 runTest(true); |
| 2102 } | 2102 } |
| 2103 | 2103 |
| 2104 } // namespace | 2104 } // namespace |
| 2105 } // namespace cc | 2105 } // namespace cc |
| OLD | NEW |