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

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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 79abc1c02f2ef28116296a3c79f43ce0a1a998c2..c87ff9f79164e4a4c01f42ae102b2f1b8eda6e6d 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 {
@@ -4415,6 +4420,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));
@@ -4703,7 +4709,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));
@@ -5987,6 +5993,7 @@ TEST_F(LayerTreeHostImplTest, DefaultMemoryAllocation) {
&proxy_,
&stats_instrumentation_,
shared_bitmap_manager_.get(),
+ gpu_memory_buffer_manager_.get(),
0);
scoped_ptr<OutputSurface> output_surface(
@@ -6028,7 +6035,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);
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698