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

Side by Side Diff: cc/layers/tiled_layer_unittest.cc

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 years, 2 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/layers/texture_layer_unittest.cc ('k') | cc/output/gl_renderer_unittest.cc » ('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 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/layers/tiled_layer.h" 5 #include "cc/layers/tiled_layer.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 output_surface_created_ = success; 74 output_surface_created_ = success;
75 run_loop_.Quit(); 75 run_loop_.Quit();
76 } 76 }
77 77
78 private: 78 private:
79 SynchronousOutputSurfaceLayerTreeHost( 79 SynchronousOutputSurfaceLayerTreeHost(
80 LayerTreeHostClient* client, 80 LayerTreeHostClient* client,
81 SharedBitmapManager* manager, 81 SharedBitmapManager* manager,
82 const LayerTreeSettings& settings, 82 const LayerTreeSettings& settings,
83 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) 83 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
84 : LayerTreeHost(client, manager, settings), 84 : LayerTreeHost(client, manager, NULL, settings),
85 output_surface_created_(false) { 85 output_surface_created_(false) {
86 LayerTreeHost::InitializeThreaded(base::MessageLoopProxy::current(), 86 LayerTreeHost::InitializeThreaded(base::MessageLoopProxy::current(),
87 impl_task_runner); 87 impl_task_runner);
88 } 88 }
89 89
90 bool output_surface_created_; 90 bool output_surface_created_;
91 base::RunLoop run_loop_; 91 base::RunLoop run_loop_;
92 }; 92 };
93 93
94 class TiledLayerTest : public testing::Test { 94 class TiledLayerTest : public testing::Test {
(...skipping 24 matching lines...) Expand all
119 CHECK(layer_tree_host_->EnsureOutputSurfaceCreated()); 119 CHECK(layer_tree_host_->EnsureOutputSurfaceCreated());
120 layer_tree_host_->SetRootLayer(Layer::Create()); 120 layer_tree_host_->SetRootLayer(Layer::Create());
121 121
122 CHECK(output_surface_->BindToClient(&output_surface_client_)); 122 CHECK(output_surface_->BindToClient(&output_surface_client_));
123 123
124 DebugScopedSetImplThreadAndMainThreadBlocked 124 DebugScopedSetImplThreadAndMainThreadBlocked
125 impl_thread_and_main_thread_blocked(proxy_); 125 impl_thread_and_main_thread_blocked(proxy_);
126 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 126 resource_provider_ = ResourceProvider::Create(output_surface_.get(),
127 shared_bitmap_manager_.get(), 127 shared_bitmap_manager_.get(),
128 nullptr, 128 nullptr,
129 nullptr,
129 0, 130 0,
130 false, 131 false,
131 1, 132 1,
132 false); 133 false);
133 host_impl_ = make_scoped_ptr( 134 host_impl_ = make_scoped_ptr(
134 new FakeLayerTreeHostImpl(proxy_, shared_bitmap_manager_.get())); 135 new FakeLayerTreeHostImpl(proxy_, shared_bitmap_manager_.get()));
135 } 136 }
136 137
137 virtual ~TiledLayerTest() { 138 virtual ~TiledLayerTest() {
138 ResourceManagerClearAllMemory(resource_manager_.get(), 139 ResourceManagerClearAllMemory(resource_manager_.get(),
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 1758
1758 // Rounding leads to an extra pixel. 1759 // Rounding leads to an extra pixel.
1759 gfx::Rect expanded_layer_rect(layer_rect); 1760 gfx::Rect expanded_layer_rect(layer_rect);
1760 expanded_layer_rect.set_height(32); 1761 expanded_layer_rect.set_height(32);
1761 EXPECT_RECT_EQ(expanded_layer_rect, 1762 EXPECT_RECT_EQ(expanded_layer_rect,
1762 layer->tracking_layer_painter()->PaintedRect()); 1763 layer->tracking_layer_painter()->PaintedRect());
1763 } 1764 }
1764 1765
1765 } // namespace 1766 } // namespace
1766 } // namespace cc 1767 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_unittest.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698