summaryrefslogtreecommitdiffstats
path: root/cc/layers
diff options
context:
space:
mode:
authorpdr <pdr@chromium.org>2015-09-22 11:08:07 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-22 18:43:33 +0000
commitf57db89518aec3379e1a34e202e14d72657ff285 (patch)
tree35a3c4ae24706520dd68dde0f01834e35f57a5ae /cc/layers
parente7ec2e67e522606022ee49e58150c8bce54f9b28 (diff)
downloadchromium_src-f57db89518aec3379e1a34e202e14d72657ff285.zip
chromium_src-f57db89518aec3379e1a34e202e14d72657ff285.tar.gz
chromium_src-f57db89518aec3379e1a34e202e14d72657ff285.tar.bz2
Revert of Cache gpu suitability in DisplayItemList, remove SetUnsuitable...ForTesting (patchset #7 id:120001 of https://codereview.chromium.org/1349913002/ )
Reason for revert: Crashes :'( http://crbug.com/534810 Original issue's description: > Cache gpu suitability in DisplayItemList, remove SetUnsuitable...ForTesting > > This patch moves the gpu suitability "cache" into display_item_list > so that calls to DisplayItemList::IsSuitableForGpuRasterization are > fast. With the cache moved we no longer need to track suitability in > the recording source and can remove SetUnsuitableForGpuRasterizationForTesting. > > BUG=524314 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/5d8f98c33491997b3ffa1c8494fe6014c4b8e4c9 > Cr-Commit-Position: refs/heads/master@{#349999} TBR=danakj@chromium.org,hendrikw@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=524314 Review URL: https://codereview.chromium.org/1361663003 Cr-Commit-Position: refs/heads/master@{#350190}
Diffstat (limited to 'cc/layers')
-rw-r--r--cc/layers/picture_layer_unittest.cc23
1 files changed, 4 insertions, 19 deletions
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index bef73ee..fe2bcb2 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -8,7 +8,6 @@
#include "cc/layers/content_layer_client.h"
#include "cc/layers/picture_layer_impl.h"
#include "cc/playback/display_item_list_settings.h"
-#include "cc/test/fake_display_list_recording_source.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/fake_picture_layer_impl.h"
@@ -79,36 +78,22 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
}
TEST(PictureLayerTest, SuitableForGpuRasterization) {
- scoped_ptr<FakeDisplayListRecordingSource> recording_source_owned(
- new FakeDisplayListRecordingSource(gfx::Size(100, 100)));
- FakeDisplayListRecordingSource* recording_source =
- recording_source_owned.get();
-
MockContentLayerClient client;
- scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::CreateWithRecordingSource(
- LayerSettings(), &client, recording_source_owned.Pass());
-
+ scoped_refptr<PictureLayer> layer =
+ PictureLayer::Create(LayerSettings(), &client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner;
scoped_ptr<FakeLayerTreeHost> host =
FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
host->SetRootLayer(layer);
-
- // Update layers to initialize the recording source.
- gfx::Size layer_bounds(200, 200);
- gfx::Rect layer_rect(layer_bounds);
- Region invalidation(layer_rect);
- recording_source->UpdateAndExpandInvalidation(
- &client, &invalidation, layer_bounds, layer_rect, 1,
- RecordingSource::RECORD_NORMALLY);
+ RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
// Layer is suitable for gpu rasterization by default.
EXPECT_TRUE(recording_source->IsSuitableForGpuRasterization());
EXPECT_TRUE(layer->IsSuitableForGpuRasterization());
// Veto gpu rasterization.
- recording_source->SetUnsuitableForGpuRasterization();
+ recording_source->SetUnsuitableForGpuRasterizationForTesting();
EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization());
EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
}