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

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

Issue 12662021: cc: Don't draw and swap if the frame will not change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "cc/layers/delegated_renderer_layer.h" 7 #include "cc/layers/delegated_renderer_layer.h"
8 #include "cc/layers/delegated_renderer_layer_impl.h" 8 #include "cc/layers/delegated_renderer_layer_impl.h"
9 #include "cc/output/delegated_frame_data.h" 9 #include "cc/output/delegated_frame_data.h"
10 #include "cc/quads/shared_quad_state.h" 10 #include "cc/quads/shared_quad_state.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, 247 virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
248 LayerTreeHostImpl::FrameData* frame, 248 LayerTreeHostImpl::FrameData* frame,
249 bool result) OVERRIDE { 249 bool result) OVERRIDE {
250 EXPECT_TRUE(result); 250 EXPECT_TRUE(result);
251 251
252 if (!first_draw_for_source_frame_) 252 if (!first_draw_for_source_frame_)
253 return result; 253 return result;
254 254
255 gfx::RectF damage_rect = frame->render_passes.back()->damage_rect; 255 gfx::RectF damage_rect;
256 if (!frame->has_no_damage) {
257 damage_rect = frame->render_passes.back()->damage_rect;
258 } else {
259 // If there is no damage, then we have no render passes to send.
260 EXPECT_TRUE(frame->render_passes.empty());
261 }
256 262
257 switch (host_impl->active_tree()->source_frame_number()) { 263 switch (host_impl->active_tree()->source_frame_number()) {
258 case 0: 264 case 0:
259 // Before the layer has a frame to display it should not 265 // Before the layer has a frame to display it should not
260 // be visible at all, and not damage anything. 266 // be visible at all, and not damage anything.
261 EXPECT_EQ(gfx::RectF(0.f, 0.f, 0.f, 0.f).ToString(), 267 EXPECT_EQ(gfx::RectF(0.f, 0.f, 0.f, 0.f).ToString(),
262 damage_rect.ToString()); 268 damage_rect.ToString());
263 break; 269 break;
264 case 1: 270 case 1:
265 EXPECT_EQ(gfx::RectF(0.f, 0.f, 10.f, 10.f).ToString(), 271 EXPECT_EQ(gfx::RectF(0.f, 0.f, 10.f, 10.f).ToString(),
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 } 1238 }
1233 } 1239 }
1234 1240
1235 virtual void AfterTest() OVERRIDE {} 1241 virtual void AfterTest() OVERRIDE {}
1236 }; 1242 };
1237 1243
1238 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestCommitWithoutTake); 1244 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestCommitWithoutTake);
1239 1245
1240 } // namespace 1246 } // namespace
1241 } // namespace cc 1247 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698