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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 475633008: cc: Use impl-side painting in LTH context lost tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check isReadyToDraw for evict texture test. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); 1613 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats();
1614 } 1614 }
1615 1615
1616 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { 1616 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) {
1617 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) 1617 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i)
1618 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); 1618 frame.will_draw_layers[i]->DidDraw(resource_provider_.get());
1619 1619
1620 // Once all layers have been drawn, pending texture uploads should no 1620 // Once all layers have been drawn, pending texture uploads should no
1621 // longer block future uploads. 1621 // longer block future uploads.
1622 resource_provider_->MarkPendingUploadsAsNonBlocking(); 1622 resource_provider_->MarkPendingUploadsAsNonBlocking();
1623
1624 if (active_tree()->RequiresHighResToDraw())
1625 active_tree()->ResetRequiresHighResToDraw();
danakj 2014/09/10 16:03:31 Can you just make the tests call Swap if they need
sohanjg 2014/09/11 06:07:57 Done.
1623 } 1626 }
1624 1627
1625 void LayerTreeHostImpl::FinishAllRendering() { 1628 void LayerTreeHostImpl::FinishAllRendering() {
1626 if (renderer_) 1629 if (renderer_)
1627 renderer_->Finish(); 1630 renderer_->Finish();
1628 } 1631 }
1629 1632
1630 void LayerTreeHostImpl::SetUseGpuRasterization(bool use_gpu) { 1633 void LayerTreeHostImpl::SetUseGpuRasterization(bool use_gpu) {
1631 if (use_gpu == use_gpu_rasterization_) 1634 if (use_gpu == use_gpu_rasterization_)
1632 return; 1635 return;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 // Note: order is important here. 2076 // Note: order is important here.
2074 renderer_.reset(); 2077 renderer_.reset();
2075 DestroyTileManager(); 2078 DestroyTileManager();
2076 resource_provider_.reset(); 2079 resource_provider_.reset();
2077 output_surface_.reset(); 2080 output_surface_.reset();
2078 2081
2079 if (!output_surface->BindToClient(this)) 2082 if (!output_surface->BindToClient(this))
2080 return false; 2083 return false;
2081 2084
2082 output_surface_ = output_surface.Pass(); 2085 output_surface_ = output_surface.Pass();
2086
2087 // There will not be anything to draw here, so set high res
2088 // to avoid checkerboards, typically when we are recovering
2089 // from lost context.
2090 active_tree_->SetRequiresHighResToDraw();
danakj 2014/09/10 16:03:31 can you move this down below us creating all the t
sohanjg 2014/09/11 06:07:57 Done.
2091
2083 resource_provider_ = 2092 resource_provider_ =
2084 ResourceProvider::Create(output_surface_.get(), 2093 ResourceProvider::Create(output_surface_.get(),
2085 shared_bitmap_manager_, 2094 shared_bitmap_manager_,
2086 proxy_->blocking_main_thread_task_runner(), 2095 proxy_->blocking_main_thread_task_runner(),
2087 settings_.highp_threshold_min, 2096 settings_.highp_threshold_min,
2088 settings_.use_rgba_4444_textures, 2097 settings_.use_rgba_4444_textures,
2089 settings_.texture_id_allocation_chunk_size, 2098 settings_.texture_id_allocation_chunk_size,
2090 settings_.use_distance_field_text); 2099 settings_.use_distance_field_text);
2091 2100
2092 if (output_surface_->capabilities().deferred_gl_initialization) 2101 if (output_surface_->capabilities().deferred_gl_initialization)
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
3378 } 3387 }
3379 3388
3380 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3389 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3381 std::vector<PictureLayerImpl*>::iterator it = 3390 std::vector<PictureLayerImpl*>::iterator it =
3382 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3391 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3383 DCHECK(it != picture_layers_.end()); 3392 DCHECK(it != picture_layers_.end());
3384 picture_layers_.erase(it); 3393 picture_layers_.erase(it);
3385 } 3394 }
3386 3395
3387 } // namespace cc 3396 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698