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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 23495022: CC: Add a scheduled action for ManageTiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused. Created 7 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
« no previous file with comments | « no previous file | cc/scheduler/scheduler.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { 312 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
313 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( 313 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime(
314 current_frame_time_in_seconds)) { 314 current_frame_time_in_seconds)) {
315 tiling_needs_update = true; 315 tiling_needs_update = true;
316 break; 316 break;
317 } 317 }
318 } 318 }
319 if (!tiling_needs_update) 319 if (!tiling_needs_update)
320 return; 320 return;
321 321
322 // At this point, tile priorities are going to be modified.
323 layer_tree_impl()->WillModifyTilePriorities();
324
325 UpdateLCDTextStatus(can_use_lcd_text()); 322 UpdateLCDTextStatus(can_use_lcd_text());
326 323
327 gfx::Transform current_screen_space_transform = screen_space_transform(); 324 gfx::Transform current_screen_space_transform = screen_space_transform();
328 325
329 gfx::Size viewport_size = layer_tree_impl()->DrawViewportSize(); 326 gfx::Size viewport_size = layer_tree_impl()->DrawViewportSize();
330 gfx::Rect viewport_in_content_space; 327 gfx::Rect viewport_in_content_space;
331 gfx::Transform screen_to_layer(gfx::Transform::kSkipInitialization); 328 gfx::Transform screen_to_layer(gfx::Transform::kSkipInitialization);
332 if (screen_space_transform().GetInverse(&screen_to_layer)) { 329 if (screen_space_transform().GetInverse(&screen_to_layer)) {
333 viewport_in_content_space = 330 viewport_in_content_space =
334 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( 331 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
(...skipping 17 matching lines...) Expand all
352 current_screen_space_transform, 349 current_screen_space_transform,
353 current_frame_time_in_seconds, 350 current_frame_time_in_seconds,
354 max_tiles_for_interest_area); 351 max_tiles_for_interest_area);
355 352
356 if (layer_tree_impl()->IsPendingTree()) 353 if (layer_tree_impl()->IsPendingTree())
357 MarkVisibleResourcesAsRequired(); 354 MarkVisibleResourcesAsRequired();
358 355
359 last_screen_space_transform_ = current_screen_space_transform; 356 last_screen_space_transform_ = current_screen_space_transform;
360 last_bounds_ = bounds(); 357 last_bounds_ = bounds();
361 last_content_scale_ = contents_scale_x(); 358 last_content_scale_ = contents_scale_x();
359
360 // Tile priorities were modified.
361 layer_tree_impl()->DidModifyTilePriorities();
362 } 362 }
363 363
364 void PictureLayerImpl::DidBecomeActive() { 364 void PictureLayerImpl::DidBecomeActive() {
365 LayerImpl::DidBecomeActive(); 365 LayerImpl::DidBecomeActive();
366 tilings_->DidBecomeActive(); 366 tilings_->DidBecomeActive();
367 layer_tree_impl()->WillModifyTilePriorities(); 367 layer_tree_impl()->DidModifyTilePriorities();
368 } 368 }
369 369
370 void PictureLayerImpl::DidBeginTracing() { 370 void PictureLayerImpl::DidBeginTracing() {
371 pile_->DidBeginTracing(); 371 pile_->DidBeginTracing();
372 } 372 }
373 373
374 void PictureLayerImpl::DidLoseOutputSurface() { 374 void PictureLayerImpl::DidLoseOutputSurface() {
375 if (tilings_) 375 if (tilings_)
376 tilings_->RemoveAllTilings(); 376 tilings_->RemoveAllTilings();
377 377
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 coverage_tiles->Append(tile_data.release()); 1080 coverage_tiles->Append(tile_data.release());
1081 } 1081 }
1082 state->Set("coverage_tiles", coverage_tiles.release()); 1082 state->Set("coverage_tiles", coverage_tiles.release());
1083 } 1083 }
1084 1084
1085 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1085 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
1086 return tilings_->GPUMemoryUsageInBytes(); 1086 return tilings_->GPUMemoryUsageInBytes();
1087 } 1087 }
1088 1088
1089 } // namespace cc 1089 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698