Commit fa27ef28 authored by sohan.jyoti's avatar sohan.jyoti Committed by Commit bot

cc: Use impl-side painting in LTH context lost tests.

BUG=401492

Review URL: https://codereview.chromium.org/475633008

Cr-Commit-Position: refs/heads/master@{#295241}
parent ee619053
......@@ -12,7 +12,8 @@ FakePictureLayer::FakePictureLayer(ContentLayerClient* client)
: PictureLayer(client),
update_count_(0),
push_properties_count_(0),
always_update_resources_(false) {
always_update_resources_(false),
output_surface_created_count_(0) {
SetBounds(gfx::Size(1, 1));
SetIsDrawable(true);
}
......@@ -36,5 +37,9 @@ void FakePictureLayer::PushPropertiesTo(LayerImpl* layer) {
push_properties_count_++;
}
void FakePictureLayer::OnOutputSurfaceCreated() {
PictureLayer::OnOutputSurfaceCreated();
output_surface_created_count_++;
}
} // namespace cc
......@@ -35,6 +35,11 @@ class FakePictureLayer : public PictureLayer {
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
virtual void OnOutputSurfaceCreated() OVERRIDE;
size_t output_surface_created_count() const {
return output_surface_created_count_;
}
private:
explicit FakePictureLayer(ContentLayerClient* client);
virtual ~FakePictureLayer();
......@@ -42,6 +47,7 @@ class FakePictureLayer : public PictureLayer {
size_t update_count_;
size_t push_properties_count_;
bool always_update_resources_;
size_t output_surface_created_count_;
};
} // namespace cc
......
......@@ -17,7 +17,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
append_quads_count_(0),
did_become_active_call_count_(0),
has_valid_tile_priorities_(false),
use_set_valid_tile_priorities_flag_(false) {
use_set_valid_tile_priorities_flag_(false),
release_resources_count_(0) {
pile_ = pile;
SetBounds(pile_->tiling_size());
SetContentBounds(pile_->tiling_size());
......@@ -31,7 +32,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
append_quads_count_(0),
did_become_active_call_count_(0),
has_valid_tile_priorities_(false),
use_set_valid_tile_priorities_flag_(false) {
use_set_valid_tile_priorities_flag_(false),
release_resources_count_(0) {
pile_ = pile;
SetBounds(layer_bounds);
SetContentBounds(layer_bounds);
......@@ -42,7 +44,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id)
append_quads_count_(0),
did_become_active_call_count_(0),
has_valid_tile_priorities_(false),
use_set_valid_tile_priorities_flag_(false) {
use_set_valid_tile_priorities_flag_(false),
release_resources_count_(0) {
}
scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl(
......@@ -179,4 +182,9 @@ bool FakePictureLayerImpl::HasValidTilePriorities() const {
: PictureLayerImpl::HasValidTilePriorities();
}
void FakePictureLayerImpl::ReleaseResources() {
PictureLayerImpl::ReleaseResources();
++release_resources_count_;
}
} // namespace cc
......@@ -112,6 +112,11 @@ class FakePictureLayerImpl : public PictureLayerImpl {
void ResetAllTilesPriorities();
PictureLayerTilingSet* GetTilings() { return tilings_.get(); }
size_t release_resources_count() const { return release_resources_count_; }
void reset_release_resources_count() { release_resources_count_ = 0; }
virtual void ReleaseResources() OVERRIDE;
protected:
FakePictureLayerImpl(
LayerTreeImpl* tree_impl,
......@@ -130,6 +135,7 @@ class FakePictureLayerImpl : public PictureLayerImpl {
size_t did_become_active_call_count_;
bool has_valid_tile_priorities_;
bool use_set_valid_tile_priorities_flag_;
size_t release_resources_count_;
};
} // namespace cc
......
......@@ -2115,6 +2115,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
client_->SetMaxSwapsPendingOnImplThread(max_frames_pending);
client_->OnCanDrawStateChanged(CanDraw());
// There will not be anything to draw here, so set high res
// to avoid checkerboards, typically when we are recovering
// from lost context.
active_tree_->SetRequiresHighResToDraw();
return true;
}
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment