Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1006)

Side by Side Diff: cc/output/software_renderer_unittest.cc

Issue 2034583002: Initialize the Display's renderer when the Display is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@displaytest
Patch Set: displayinit: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/software_renderer.cc ('k') | cc/output/vulkan_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 24 matching lines...) Expand all
35 public: 35 public:
36 void InitializeRenderer( 36 void InitializeRenderer(
37 std::unique_ptr<SoftwareOutputDevice> software_output_device) { 37 std::unique_ptr<SoftwareOutputDevice> software_output_device) {
38 output_surface_ = 38 output_surface_ =
39 FakeOutputSurface::CreateSoftware(std::move(software_output_device)); 39 FakeOutputSurface::CreateSoftware(std::move(software_output_device));
40 CHECK(output_surface_->BindToClient(&output_surface_client_)); 40 CHECK(output_surface_->BindToClient(&output_surface_client_));
41 41
42 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); 42 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
43 resource_provider_ = FakeResourceProvider::Create( 43 resource_provider_ = FakeResourceProvider::Create(
44 output_surface_.get(), shared_bitmap_manager_.get()); 44 output_surface_.get(), shared_bitmap_manager_.get());
45 renderer_ = SoftwareRenderer::Create( 45 renderer_ = base::MakeUnique<SoftwareRenderer>(
46 this, &settings_, output_surface_.get(), resource_provider()); 46 this, &settings_, output_surface_.get(), resource_provider());
47 } 47 }
48 48
49 ResourceProvider* resource_provider() const { 49 ResourceProvider* resource_provider() const {
50 return resource_provider_.get(); 50 return resource_provider_.get();
51 } 51 }
52 52
53 SoftwareRenderer* renderer() const { return renderer_.get(); } 53 SoftwareRenderer* renderer() const { return renderer_.get(); }
54 54
55 // RendererClient implementation. 55 // RendererClient implementation.
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 viewport_rect, clip_rect); 447 viewport_rect, clip_rect);
448 448
449 // The damage rect should be reported to the SoftwareOutputDevice. 449 // The damage rect should be reported to the SoftwareOutputDevice.
450 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->damage_rect_at_start()); 450 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->damage_rect_at_start());
451 // The SkCanvas should be clipped to the damage rect. 451 // The SkCanvas should be clipped to the damage rect.
452 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->clip_rect_at_end()); 452 EXPECT_EQ(gfx::Rect(2, 2, 3, 3), device->clip_rect_at_end());
453 } 453 }
454 454
455 } // namespace 455 } // namespace
456 } // namespace cc 456 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_renderer.cc ('k') | cc/output/vulkan_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698