| 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/synchronization/lock.h" | 7 #include "base/synchronization/lock.h" |
| 8 #include "cc/animation/timing_function.h" | 8 #include "cc/animation/timing_function.h" |
| 9 #include "cc/layers/content_layer.h" | 9 #include "cc/layers/content_layer.h" |
| 10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 Layer* m_testLayer; | 688 Layer* m_testLayer; |
| 689 }; | 689 }; |
| 690 | 690 |
| 691 class ContentLayerWithUpdateTracking : public ContentLayer { | 691 class ContentLayerWithUpdateTracking : public ContentLayer { |
| 692 public: | 692 public: |
| 693 static scoped_refptr<ContentLayerWithUpdateTracking> Create(ContentLayerClie
nt* client) { return make_scoped_refptr(new ContentLayerWithUpdateTracking(clien
t)); } | 693 static scoped_refptr<ContentLayerWithUpdateTracking> Create(ContentLayerClie
nt* client) { return make_scoped_refptr(new ContentLayerWithUpdateTracking(clien
t)); } |
| 694 | 694 |
| 695 int paintContentsCount() { return m_paintContentsCount; } | 695 int paintContentsCount() { return m_paintContentsCount; } |
| 696 void resetPaintContentsCount() { m_paintContentsCount = 0; } | 696 void resetPaintContentsCount() { m_paintContentsCount = 0; } |
| 697 | 697 |
| 698 virtual void Update(ResourceUpdateQueue* queue, const OcclusionTracker* occl
usion, RenderingStats* stats) OVERRIDE | 698 virtual void Update(ResourceUpdateQueue* queue, const OcclusionTracker* occl
usion) OVERRIDE |
| 699 { | 699 { |
| 700 ContentLayer::Update(queue, occlusion, stats); | 700 ContentLayer::Update(queue, occlusion); |
| 701 m_paintContentsCount++; | 701 m_paintContentsCount++; |
| 702 } | 702 } |
| 703 | 703 |
| 704 private: | 704 private: |
| 705 explicit ContentLayerWithUpdateTracking(ContentLayerClient* client) | 705 explicit ContentLayerWithUpdateTracking(ContentLayerClient* client) |
| 706 : ContentLayer(client) | 706 : ContentLayer(client) |
| 707 , m_paintContentsCount(0) | 707 , m_paintContentsCount(0) |
| 708 { | 708 { |
| 709 SetAnchorPoint(gfx::PointF(0, 0)); | 709 SetAnchorPoint(gfx::PointF(0, 0)); |
| 710 SetBounds(gfx::Size(10, 10)); | 710 SetBounds(gfx::Size(10, 10)); |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 scoped_refptr<ContentLayerWithUpdateTracking> m_surfaceLayer2; | 1369 scoped_refptr<ContentLayerWithUpdateTracking> m_surfaceLayer2; |
| 1370 scoped_refptr<ContentLayerWithUpdateTracking> m_replicaLayer2; | 1370 scoped_refptr<ContentLayerWithUpdateTracking> m_replicaLayer2; |
| 1371 }; | 1371 }; |
| 1372 | 1372 |
| 1373 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSurfaceNotAllocatedForLayersOuts
ideMemoryLimit) | 1373 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSurfaceNotAllocatedForLayersOuts
ideMemoryLimit) |
| 1374 | 1374 |
| 1375 class EvictionTestLayer : public Layer { | 1375 class EvictionTestLayer : public Layer { |
| 1376 public: | 1376 public: |
| 1377 static scoped_refptr<EvictionTestLayer> Create() { return make_scoped_refptr
(new EvictionTestLayer()); } | 1377 static scoped_refptr<EvictionTestLayer> Create() { return make_scoped_refptr
(new EvictionTestLayer()); } |
| 1378 | 1378 |
| 1379 virtual void Update(ResourceUpdateQueue*, const OcclusionTracker*, Rendering
Stats*) OVERRIDE; | 1379 virtual void Update(ResourceUpdateQueue*, const OcclusionTracker*) OVERRIDE; |
| 1380 virtual bool DrawsContent() const OVERRIDE { return true; } | 1380 virtual bool DrawsContent() const OVERRIDE { return true; } |
| 1381 | 1381 |
| 1382 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; | 1382 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; |
| 1383 virtual void PushPropertiesTo(LayerImpl*) OVERRIDE; | 1383 virtual void PushPropertiesTo(LayerImpl*) OVERRIDE; |
| 1384 virtual void SetTexturePriorities(const PriorityCalculator&) OVERRIDE; | 1384 virtual void SetTexturePriorities(const PriorityCalculator&) OVERRIDE; |
| 1385 | 1385 |
| 1386 bool haveBackingTexture() const { return m_texture.get() ? m_texture->have_b
acking_texture() : false; } | 1386 bool haveBackingTexture() const { return m_texture.get() ? m_texture->have_b
acking_texture() : false; } |
| 1387 | 1387 |
| 1388 private: | 1388 private: |
| 1389 EvictionTestLayer() : Layer() { } | 1389 EvictionTestLayer() : Layer() { } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1428 }; | 1428 }; |
| 1429 | 1429 |
| 1430 void EvictionTestLayer::SetTexturePriorities(const PriorityCalculator&) | 1430 void EvictionTestLayer::SetTexturePriorities(const PriorityCalculator&) |
| 1431 { | 1431 { |
| 1432 createTextureIfNeeded(); | 1432 createTextureIfNeeded(); |
| 1433 if (!m_texture.get()) | 1433 if (!m_texture.get()) |
| 1434 return; | 1434 return; |
| 1435 m_texture->set_request_priority(PriorityCalculator::UIPriority(true)); | 1435 m_texture->set_request_priority(PriorityCalculator::UIPriority(true)); |
| 1436 } | 1436 } |
| 1437 | 1437 |
| 1438 void EvictionTestLayer::Update(ResourceUpdateQueue* queue, const OcclusionTracke
r*, RenderingStats*) | 1438 void EvictionTestLayer::Update(ResourceUpdateQueue* queue, const OcclusionTracke
r*) |
| 1439 { | 1439 { |
| 1440 createTextureIfNeeded(); | 1440 createTextureIfNeeded(); |
| 1441 if (!m_texture.get()) | 1441 if (!m_texture.get()) |
| 1442 return; | 1442 return; |
| 1443 | 1443 |
| 1444 gfx::Rect fullRect(0, 0, 10, 10); | 1444 gfx::Rect fullRect(0, 0, 10, 10); |
| 1445 ResourceUpdate upload = ResourceUpdate::Create( | 1445 ResourceUpdate upload = ResourceUpdate::Create( |
| 1446 m_texture.get(), &m_bitmap, fullRect, fullRect, gfx::Vector2d()); | 1446 m_texture.get(), &m_bitmap, fullRect, fullRect, gfx::Vector2d()); |
| 1447 queue->AppendFullUpload(upload); | 1447 queue->AppendFullUpload(upload); |
| 1448 } | 1448 } |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2344 } | 2344 } |
| 2345 | 2345 |
| 2346 private: | 2346 private: |
| 2347 NotificationClient client_; | 2347 NotificationClient client_; |
| 2348 }; | 2348 }; |
| 2349 | 2349 |
| 2350 SINGLE_THREAD_TEST_F(LayerTreeHostTestLCDNotification) | 2350 SINGLE_THREAD_TEST_F(LayerTreeHostTestLCDNotification) |
| 2351 | 2351 |
| 2352 } // namespace | 2352 } // namespace |
| 2353 } // namespace cc | 2353 } // namespace cc |
| OLD | NEW |