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

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

Issue 13939005: cc: Add strict layer property change checking and handle bounds changes during paint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/CHECK/DCHECK/ 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/layers/scrollbar_layer_unittest.cc ('k') | cc/layers/tiled_layer_unittest.cc » ('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 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/layers/tiled_layer.h" 5 #include "cc/layers/tiled_layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 int left, 463 int left,
464 int top, 464 int top,
465 int right, 465 int right,
466 int bottom, 466 int bottom,
467 ResourceUpdateQueue* queue, 467 ResourceUpdateQueue* queue,
468 const OcclusionTracker* occlusion, 468 const OcclusionTracker* occlusion,
469 RenderingStats* stats) { 469 RenderingStats* stats) {
470 // The update_rect should be in layer space. So we have to convert the 470 // The update_rect should be in layer space. So we have to convert the
471 // paint_rect from content space to layer space. 471 // paint_rect from content space to layer space.
472 float width_scale = 472 float width_scale =
473 bounds().width() / static_cast<float>(content_bounds().width()); 473 paint_properties().bounds.width() /
474 static_cast<float>(content_bounds().width());
474 float height_scale = 475 float height_scale =
475 bounds().height() / static_cast<float>(content_bounds().height()); 476 paint_properties().bounds.height() /
477 static_cast<float>(content_bounds().height());
476 update_rect_ = gfx::ScaleRect(paint_rect, width_scale, height_scale); 478 update_rect_ = gfx::ScaleRect(paint_rect, width_scale, height_scale);
477 479
478 // Calling PrepareToUpdate() calls into WebKit to paint, which may have the 480 // Calling PrepareToUpdate() calls into WebKit to paint, which may have the
479 // side effect of disabling compositing, which causes our reference to the 481 // side effect of disabling compositing, which causes our reference to the
480 // texture updater to be deleted. However, we can't free the memory backing 482 // texture updater to be deleted. However, we can't free the memory backing
481 // the SkCanvas until the paint finishes, so we grab a local reference here to 483 // the SkCanvas until the paint finishes, so we grab a local reference here to
482 // hold the updater alive until the paint completes. 484 // hold the updater alive until the paint completes.
483 scoped_refptr<LayerUpdater> protector(Updater()); 485 scoped_refptr<LayerUpdater> protector(Updater());
484 gfx::Rect painted_opaque_rect; 486 gfx::Rect painted_opaque_rect;
485 Updater()->PrepareToUpdate(paint_rect, 487 Updater()->PrepareToUpdate(paint_rect,
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 gfx::Rect prepaint_rect = visible_content_rect(); 884 gfx::Rect prepaint_rect = visible_content_rect();
883 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, 885 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns,
884 -tiler_->tile_size().height() * kPrepaintRows); 886 -tiler_->tile_size().height() * kPrepaintRows);
885 gfx::Rect content_rect(content_bounds()); 887 gfx::Rect content_rect(content_bounds());
886 prepaint_rect.Intersect(content_rect); 888 prepaint_rect.Intersect(content_rect);
887 889
888 return prepaint_rect; 890 return prepaint_rect;
889 } 891 }
890 892
891 } // namespace cc 893 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/layers/tiled_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698