| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 namespace cc { | 32 namespace cc { |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 class SoftwareRendererTest : public testing::Test { | 35 class SoftwareRendererTest : public testing::Test { |
| 36 public: | 36 public: |
| 37 void InitializeRenderer( | 37 void InitializeRenderer( |
| 38 std::unique_ptr<SoftwareOutputDevice> software_output_device) { | 38 std::unique_ptr<SoftwareOutputDevice> software_output_device) { |
| 39 output_surface_ = | 39 output_surface_ = |
| 40 FakeOutputSurface::CreateSoftware(std::move(software_output_device)); | 40 FakeOutputSurface::CreateSoftware(std::move(software_output_device)); |
| 41 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 41 output_surface_->BindToClient(&output_surface_client_); |
| 42 | 42 |
| 43 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 43 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
| 44 resource_provider_ = | 44 resource_provider_ = |
| 45 FakeResourceProvider::Create(nullptr, shared_bitmap_manager_.get()); | 45 FakeResourceProvider::Create(nullptr, shared_bitmap_manager_.get()); |
| 46 renderer_ = base::MakeUnique<SoftwareRenderer>( | 46 renderer_ = base::MakeUnique<SoftwareRenderer>( |
| 47 &settings_, output_surface_.get(), resource_provider()); | 47 &settings_, output_surface_.get(), resource_provider()); |
| 48 renderer_->Initialize(); | 48 renderer_->Initialize(); |
| 49 renderer_->SetVisible(true); | 49 renderer_->SetVisible(true); |
| 50 } | 50 } |
| 51 | 51 |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 viewport_size); | 443 viewport_size); |
| 444 | 444 |
| 445 // The damage rect should be reported to the SoftwareOutputDevice. | 445 // The damage rect should be reported to the SoftwareOutputDevice. |
| 446 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->damage_rect_at_start()); | 446 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->damage_rect_at_start()); |
| 447 // The SkCanvas should be clipped to the damage rect. | 447 // The SkCanvas should be clipped to the damage rect. |
| 448 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->clip_rect_at_end()); | 448 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->clip_rect_at_end()); |
| 449 } | 449 } |
| 450 | 450 |
| 451 } // namespace | 451 } // namespace |
| 452 } // namespace cc | 452 } // namespace cc |
| OLD | NEW |