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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 279013002: Remove CompositeAndReadback from LayerTreeHost(Impl) and the Proxys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-cnr-lth-proxy-renderer: rebase-on-drawresult Created 6 years, 7 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
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index a920f5a28ac25e3425de7d50ff0f7ca0df5fffe1..a39627b644b16ab372a809ee227a3f567092576b 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -55,31 +55,6 @@ SingleThreadProxy::~SingleThreadProxy() {
DCHECK(!layer_tree_host_impl_);
}
-bool SingleThreadProxy::CompositeAndReadback(void* pixels,
- const gfx::Rect& rect) {
- TRACE_EVENT0("cc", "SingleThreadProxy::CompositeAndReadback");
- DCHECK(Proxy::IsMainThread());
-
- gfx::Rect device_viewport_damage_rect = rect;
-
- LayerTreeHostImpl::FrameData frame;
- if (!CommitAndComposite(gfx::FrameTime::Now(),
- device_viewport_damage_rect,
- true, // for_readback
- &frame))
- return false;
-
- {
- DebugScopedSetImplThread impl(this);
- layer_tree_host_impl_->Readback(pixels, rect);
-
- if (layer_tree_host_impl_->IsContextLost())
- return false;
- }
-
- return true;
-}
-
void SingleThreadProxy::FinishAllRendering() {
TRACE_EVENT0("cc", "SingleThreadProxy::FinishAllRendering");
DCHECK(Proxy::IsMainThread());
@@ -363,13 +338,9 @@ void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() {
// scheduling)
void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately");
- gfx::Rect device_viewport_damage_rect;
LayerTreeHostImpl::FrameData frame;
- if (CommitAndComposite(frame_begin_time,
- device_viewport_damage_rect,
- false, // for_readback
- &frame)) {
+ if (CommitAndComposite(frame_begin_time, &frame)) {
{
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
DebugScopedSetImplThread impl(this);
@@ -415,8 +386,6 @@ void SingleThreadProxy::ForceSerializeOnSwapBuffers() {
bool SingleThreadProxy::CommitAndComposite(
base::TimeTicks frame_begin_time,
- const gfx::Rect& device_viewport_damage_rect,
- bool for_readback,
LayerTreeHostImpl::FrameData* frame) {
TRACE_EVENT0("cc", "SingleThreadProxy::CommitAndComposite");
DCHECK(Proxy::IsMainThread());
@@ -442,8 +411,7 @@ bool SingleThreadProxy::CommitAndComposite(
layer_tree_host_->WillCommit();
DoCommit(queue.Pass());
- bool result = DoComposite(
- frame_begin_time, device_viewport_damage_rect, for_readback, frame);
+ bool result = DoComposite(frame_begin_time, frame);
layer_tree_host_->DidBeginMainFrame();
return result;
}
@@ -462,8 +430,6 @@ void SingleThreadProxy::UpdateBackgroundAnimateTicking() {
bool SingleThreadProxy::DoComposite(
base::TimeTicks frame_begin_time,
- const gfx::Rect& device_viewport_damage_rect,
- bool for_readback,
LayerTreeHostImpl::FrameData* frame) {
TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite");
DCHECK(!layer_tree_host_->output_surface_lost());
@@ -473,13 +439,11 @@ bool SingleThreadProxy::DoComposite(
DebugScopedSetImplThread impl(this);
base::AutoReset<bool> mark_inside(&inside_draw_, true);
- bool can_do_readback = layer_tree_host_impl_->renderer()->CanReadPixels();
-
// We guard PrepareToDraw() with CanDraw() because it always returns a valid
// frame, so can only be used when such a frame is possible. Since
// DrawLayers() depends on the result of PrepareToDraw(), it is guarded on
// CanDraw() as well.
- if (!ShouldComposite() || (for_readback && !can_do_readback)) {
+ if (!ShouldComposite()) {
UpdateBackgroundAnimateTicking();
return false;
}
@@ -489,7 +453,7 @@ bool SingleThreadProxy::DoComposite(
UpdateBackgroundAnimateTicking();
if (!layer_tree_host_impl_->IsContextLost()) {
- layer_tree_host_impl_->PrepareToDraw(frame, device_viewport_damage_rect);
+ layer_tree_host_impl_->PrepareToDraw(frame);
layer_tree_host_impl_->DrawLayers(frame, frame_begin_time);
layer_tree_host_impl_->DidDrawAllLayers(*frame);
}
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698