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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 375303002: cc: Refactor ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed. Created 6 years, 5 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 8050377440ffb539d1b56570176a9c2e6dcad118..71e0c9d4cc442156c9538c2e7650e81eb61d6aee 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -64,11 +64,14 @@
#include "cc/trees/occlusion_tracker.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/tree_synchronizer.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "ui/gfx/frame_time.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/vector2d_conversions.h"
+using gpu::gles2::GLES2Interface;
+
namespace {
void DidVisibilityChange(cc::LayerTreeHostImpl* id, bool visible) {
@@ -1374,8 +1377,11 @@ void LayerTreeHostImpl::ReclaimResources(const CompositorFrameAck* ack) {
// If we're not visible, we likely released resources, so we want to
// aggressively flush here to make sure those DeleteTextures make it to the
// GPU process to free up the memory.
- if (resource_provider_ && !visible_)
- resource_provider_->ShallowFlushIfSupported();
+ if (output_surface_ && !visible_) {
danakj 2014/07/11 17:39:59 check if the context_provider is NULL instead. th
sohanjg 2014/07/12 11:08:26 Done.
sohanjg 2014/07/12 11:08:26 Done.
+ GLES2Interface* gl = output_surface_->context_provider()->ContextGL();
+ if (gl)
danakj 2014/07/11 17:39:59 not needed
sohanjg 2014/07/12 11:08:26 Done.
+ gl->ShallowFlushCHROMIUM();
+ }
}
void LayerTreeHostImpl::OnCanDrawStateChangedForTree() {
@@ -1909,8 +1915,10 @@ void LayerTreeHostImpl::CreateAndSetTileManager() {
GL_TEXTURE_2D,
resource_provider_->best_texture_format());
- raster_worker_pool_ = GpuRasterWorkerPool::Create(
- proxy_->ImplThreadTaskRunner(), resource_provider_.get());
+ raster_worker_pool_ =
+ GpuRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(),
+ context_provider,
+ resource_provider_.get());
on_demand_task_graph_runner_ = &synchronous_task_graph_runner_;
} else if (UseZeroCopyTextureUpload()) {
resource_pool_ =
@@ -1937,6 +1945,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager() {
raster_worker_pool_ = ImageCopyRasterWorkerPool::Create(
proxy_->ImplThreadTaskRunner(),
RasterWorkerPool::GetTaskGraphRunner(),
+ context_provider,
resource_provider_.get(),
staging_resource_pool_.get());
on_demand_task_graph_runner_ = RasterWorkerPool::GetTaskGraphRunner();
@@ -1949,6 +1958,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager() {
raster_worker_pool_ = PixelBufferRasterWorkerPool::Create(
proxy_->ImplThreadTaskRunner(),
RasterWorkerPool::GetTaskGraphRunner(),
+ context_provider,
resource_provider_.get(),
transfer_buffer_memory_limit_);
on_demand_task_graph_runner_ = RasterWorkerPool::GetTaskGraphRunner();

Powered by Google App Engine
This is Rietveld 408576698