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) ...@@ -12,7 +12,8 @@ FakePictureLayer::FakePictureLayer(ContentLayerClient* client)
: PictureLayer(client), : PictureLayer(client),
update_count_(0), update_count_(0),
push_properties_count_(0), push_properties_count_(0),
always_update_resources_(false) { always_update_resources_(false),
output_surface_created_count_(0) {
SetBounds(gfx::Size(1, 1)); SetBounds(gfx::Size(1, 1));
SetIsDrawable(true); SetIsDrawable(true);
} }
...@@ -36,5 +37,9 @@ void FakePictureLayer::PushPropertiesTo(LayerImpl* layer) { ...@@ -36,5 +37,9 @@ void FakePictureLayer::PushPropertiesTo(LayerImpl* layer) {
push_properties_count_++; push_properties_count_++;
} }
void FakePictureLayer::OnOutputSurfaceCreated() {
PictureLayer::OnOutputSurfaceCreated();
output_surface_created_count_++;
}
} // namespace cc } // namespace cc
...@@ -35,6 +35,11 @@ class FakePictureLayer : public PictureLayer { ...@@ -35,6 +35,11 @@ class FakePictureLayer : public PictureLayer {
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
virtual void OnOutputSurfaceCreated() OVERRIDE;
size_t output_surface_created_count() const {
return output_surface_created_count_;
}
private: private:
explicit FakePictureLayer(ContentLayerClient* client); explicit FakePictureLayer(ContentLayerClient* client);
virtual ~FakePictureLayer(); virtual ~FakePictureLayer();
...@@ -42,6 +47,7 @@ class FakePictureLayer : public PictureLayer { ...@@ -42,6 +47,7 @@ class FakePictureLayer : public PictureLayer {
size_t update_count_; size_t update_count_;
size_t push_properties_count_; size_t push_properties_count_;
bool always_update_resources_; bool always_update_resources_;
size_t output_surface_created_count_;
}; };
} // namespace cc } // namespace cc
......
...@@ -17,7 +17,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, ...@@ -17,7 +17,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
append_quads_count_(0), append_quads_count_(0),
did_become_active_call_count_(0), did_become_active_call_count_(0),
has_valid_tile_priorities_(false), 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; pile_ = pile;
SetBounds(pile_->tiling_size()); SetBounds(pile_->tiling_size());
SetContentBounds(pile_->tiling_size()); SetContentBounds(pile_->tiling_size());
...@@ -31,7 +32,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, ...@@ -31,7 +32,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
append_quads_count_(0), append_quads_count_(0),
did_become_active_call_count_(0), did_become_active_call_count_(0),
has_valid_tile_priorities_(false), 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; pile_ = pile;
SetBounds(layer_bounds); SetBounds(layer_bounds);
SetContentBounds(layer_bounds); SetContentBounds(layer_bounds);
...@@ -42,7 +44,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) ...@@ -42,7 +44,8 @@ FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id)
append_quads_count_(0), append_quads_count_(0),
did_become_active_call_count_(0), did_become_active_call_count_(0),
has_valid_tile_priorities_(false), 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( scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl(
...@@ -179,4 +182,9 @@ bool FakePictureLayerImpl::HasValidTilePriorities() const { ...@@ -179,4 +182,9 @@ bool FakePictureLayerImpl::HasValidTilePriorities() const {
: PictureLayerImpl::HasValidTilePriorities(); : PictureLayerImpl::HasValidTilePriorities();
} }
void FakePictureLayerImpl::ReleaseResources() {
PictureLayerImpl::ReleaseResources();
++release_resources_count_;
}
} // namespace cc } // namespace cc
...@@ -112,6 +112,11 @@ class FakePictureLayerImpl : public PictureLayerImpl { ...@@ -112,6 +112,11 @@ class FakePictureLayerImpl : public PictureLayerImpl {
void ResetAllTilesPriorities(); void ResetAllTilesPriorities();
PictureLayerTilingSet* GetTilings() { return tilings_.get(); } 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: protected:
FakePictureLayerImpl( FakePictureLayerImpl(
LayerTreeImpl* tree_impl, LayerTreeImpl* tree_impl,
...@@ -130,6 +135,7 @@ class FakePictureLayerImpl : public PictureLayerImpl { ...@@ -130,6 +135,7 @@ class FakePictureLayerImpl : public PictureLayerImpl {
size_t did_become_active_call_count_; size_t did_become_active_call_count_;
bool has_valid_tile_priorities_; bool has_valid_tile_priorities_;
bool use_set_valid_tile_priorities_flag_; bool use_set_valid_tile_priorities_flag_;
size_t release_resources_count_;
}; };
} // namespace cc } // namespace cc
......
...@@ -2115,6 +2115,11 @@ bool LayerTreeHostImpl::InitializeRenderer( ...@@ -2115,6 +2115,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); client_->SetMaxSwapsPendingOnImplThread(max_frames_pending);
client_->OnCanDrawStateChanged(CanDraw()); 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; 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