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

Unified Diff: cc/trees/layer_tree_host_impl_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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 06bf669ca947a3811eb77ffa1c5c2b81d994c86a..0209e5a44687b02fb643858249852610f16d9f05 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -51,6 +51,7 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/render_pass_test_common.h"
+#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_impl.h"
@@ -82,7 +83,8 @@ class LayerTreeHostImplTest : public testing::Test,
base::MessageLoopProxy::current()),
always_impl_thread_(&proxy_),
always_main_thread_blocked_(&proxy_),
- shared_bitmap_manager_(new TestSharedBitmapManager()),
+ shared_bitmap_manager_(new TestSharedBitmapManager),
+ gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager),
on_can_draw_state_changed_called_(false),
did_notify_ready_to_activate_(false),
did_request_commit_(false),
@@ -175,6 +177,7 @@ class LayerTreeHostImplTest : public testing::Test,
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
0);
bool init = host_impl_->InitializeRenderer(output_surface.Pass());
host_impl_->SetViewportSize(gfx::Size(10, 10));
@@ -392,7 +395,8 @@ class LayerTreeHostImplTest : public testing::Test,
DebugScopedSetImplThread always_impl_thread_;
DebugScopedSetMainThreadBlocked always_main_thread_blocked_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
+ scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
scoped_ptr<LayerTreeHostImpl> host_impl_;
FakeRenderingStatsInstrumentation stats_instrumentation_;
bool on_can_draw_state_changed_called_;
@@ -1366,6 +1370,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
proxy,
rendering_stats_instrumentation,
manager,
+ NULL,
0) {}
virtual BeginFrameArgs CurrentBeginFrameArgs() const override {
@@ -4410,6 +4415,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager.get(),
+ NULL,
0);
layer_tree_host_impl->InitializeRenderer(output_surface.Pass());
layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500));
@@ -4699,7 +4705,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
LayerTreeSettings settings;
settings.partial_swap_enabled = partial_swap;
scoped_ptr<LayerTreeHostImpl> my_host_impl = LayerTreeHostImpl::Create(
- settings, client, proxy, stats_instrumentation, manager, 0);
+ settings, client, proxy, stats_instrumentation, manager, NULL, 0);
my_host_impl->InitializeRenderer(output_surface.Pass());
my_host_impl->SetViewportSize(gfx::Size(100, 100));
@@ -5983,6 +5989,7 @@ TEST_F(LayerTreeHostImplTest, DefaultMemoryAllocation) {
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
0);
scoped_ptr<OutputSurface> output_surface(
@@ -6024,7 +6031,7 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) {
LayerTreeSettings settings;
settings.gpu_rasterization_enabled = true;
host_impl_ = LayerTreeHostImpl::Create(
- settings, this, &proxy_, &stats_instrumentation_, NULL, 0);
+ settings, this, &proxy_, &stats_instrumentation_, NULL, NULL, 0);
host_impl_->SetUseGpuRasterization(true);
host_impl_->SetVisible(true);
host_impl_->SetMemoryPolicy(policy1);

Powered by Google App Engine
This is Rietveld 408576698