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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2658 frame.render_passes[0]->quad_list, gfx::Rect(viewport_size)); | 2658 frame.render_passes[0]->quad_list, gfx::Rect(viewport_size)); |
2659 host_impl_->DidDrawAllLayers(frame); | 2659 host_impl_->DidDrawAllLayers(frame); |
2660 } | 2660 } |
2661 } | 2661 } |
2662 | 2662 |
2663 | 2663 |
2664 class ReshapeTrackerContext: public TestWebGraphicsContext3D { | 2664 class ReshapeTrackerContext: public TestWebGraphicsContext3D { |
2665 public: | 2665 public: |
2666 ReshapeTrackerContext() : reshape_called_(false) {} | 2666 ReshapeTrackerContext() : reshape_called_(false) {} |
2667 | 2667 |
2668 virtual void reshape(int width, int height) OVERRIDE { | 2668 virtual void reshapeWithScaleFactor( |
| 2669 int width, int height, float scale_factor) OVERRIDE { |
2669 reshape_called_ = true; | 2670 reshape_called_ = true; |
2670 } | 2671 } |
2671 | 2672 |
2672 bool reshape_called() const { return reshape_called_; } | 2673 bool reshape_called() const { return reshape_called_; } |
2673 | 2674 |
2674 private: | 2675 private: |
2675 bool reshape_called_; | 2676 bool reshape_called_; |
2676 }; | 2677 }; |
2677 | 2678 |
2678 class FakeDrawableLayerImpl: public LayerImpl { | 2679 class FakeDrawableLayerImpl: public LayerImpl { |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4500 | 4501 |
4501 virtual bool HaveCachedResourcesForRenderPassId(RenderPass::Id id) const | 4502 virtual bool HaveCachedResourcesForRenderPassId(RenderPass::Id id) const |
4502 OVERRIDE { | 4503 OVERRIDE { |
4503 return textures_.count(id); | 4504 return textures_.count(id); |
4504 } | 4505 } |
4505 | 4506 |
4506 // RendererClient implementation. | 4507 // RendererClient implementation. |
4507 virtual gfx::Size DeviceViewportSize() const OVERRIDE { | 4508 virtual gfx::Size DeviceViewportSize() const OVERRIDE { |
4508 return viewport_size_; | 4509 return viewport_size_; |
4509 } | 4510 } |
| 4511 virtual float DeviceScaleFactor() const OVERRIDE { |
| 4512 return 1.f; |
| 4513 } |
4510 virtual const LayerTreeSettings& Settings() const OVERRIDE { | 4514 virtual const LayerTreeSettings& Settings() const OVERRIDE { |
4511 return settings_; | 4515 return settings_; |
4512 } | 4516 } |
4513 virtual void SetFullRootLayerDamage() OVERRIDE {} | 4517 virtual void SetFullRootLayerDamage() OVERRIDE {} |
4514 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) | 4518 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
4515 OVERRIDE {} | 4519 OVERRIDE {} |
4516 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) | 4520 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
4517 OVERRIDE {} | 4521 OVERRIDE {} |
4518 virtual bool HasImplThread() const OVERRIDE { return false; } | 4522 virtual bool HasImplThread() const OVERRIDE { return false; } |
4519 virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } | 4523 virtual bool ShouldClearRootRenderPass() const OVERRIDE { return true; } |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5695 EXPECT_EQ(0, software_device->frames_ended_); | 5699 EXPECT_EQ(0, software_device->frames_ended_); |
5696 | 5700 |
5697 DrawFrame(); | 5701 DrawFrame(); |
5698 | 5702 |
5699 EXPECT_EQ(1, software_device->frames_began_); | 5703 EXPECT_EQ(1, software_device->frames_began_); |
5700 EXPECT_EQ(1, software_device->frames_ended_); | 5704 EXPECT_EQ(1, software_device->frames_ended_); |
5701 } | 5705 } |
5702 | 5706 |
5703 } // namespace | 5707 } // namespace |
5704 } // namespace cc | 5708 } // namespace cc |
OLD | NEW |