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

Side by Side Diff: cc/tiled_layer.cc

Issue 11644036: cc: Don't let invalidations that we're going to handle immediately cause an extra commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ignoreSetNeedsCommit Created 8 years 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/layer_tree_host_unittest_animation.cc ('k') | no next file » | 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/tiled_layer.h" 5 #include "cc/tiled_layer.h"
6 6
7 #include "base/auto_reset.h"
7 #include "base/basictypes.h" 8 #include "base/basictypes.h"
8 #include "build/build_config.h" 9 #include "build/build_config.h"
9 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
10 #include "cc/layer_tree_host.h" 11 #include "cc/layer_tree_host.h"
11 #include "cc/overdraw_metrics.h" 12 #include "cc/overdraw_metrics.h"
12 #include "cc/tiled_layer_impl.h" 13 #include "cc/tiled_layer_impl.h"
13 #include "third_party/khronos/GLES2/gl2.h" 14 #include "third_party/khronos/GLES2/gl2.h"
14 #include "ui/gfx/rect_conversions.h" 15 #include "ui/gfx/rect_conversions.h"
15 16
16 using namespace std; 17 using namespace std;
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 m_predictedVisibleRect.Intersect(bound); 628 m_predictedVisibleRect.Intersect(bound);
628 } 629 }
629 m_previousContentBounds = contentBounds(); 630 m_previousContentBounds = contentBounds();
630 m_previousVisibleRect = visibleContentRect(); 631 m_previousVisibleRect = visibleContentRect();
631 } 632 }
632 633
633 void TiledLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* occl usion, RenderingStats& stats) 634 void TiledLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* occl usion, RenderingStats& stats)
634 { 635 {
635 DCHECK(!m_skipsDraw && !m_failedUpdate); // Did resetUpdateState get skipped ? 636 DCHECK(!m_skipsDraw && !m_failedUpdate); // Did resetUpdateState get skipped ?
636 637
637 ContentsScalingLayer::update(queue, occlusion, stats); 638 {
639 base::AutoReset<bool> ignoreSetNeedsCommit(&m_ignoreSetNeedsCommit, true );
638 640
639 updateBounds(); 641 ContentsScalingLayer::update(queue, occlusion, stats);
642 updateBounds();
643 }
644
640 if (m_tiler->hasEmptyBounds() || !drawsContent()) 645 if (m_tiler->hasEmptyBounds() || !drawsContent())
641 return; 646 return;
642 647
643 bool didPaint = false; 648 bool didPaint = false;
644 649
645 // Animation pre-paint. If the layer is small, try to paint it all 650 // Animation pre-paint. If the layer is small, try to paint it all
646 // immediately whether or not it is occluded, to avoid paint/upload 651 // immediately whether or not it is occluded, to avoid paint/upload
647 // hiccups while it is animating. 652 // hiccups while it is animating.
648 if (isSmallAnimatedLayer()) { 653 if (isSmallAnimatedLayer()) {
649 int left, top, right, bottom; 654 int left, top, right, bottom;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 gfx::Rect prepaintRect = visibleContentRect(); 765 gfx::Rect prepaintRect = visibleContentRect();
761 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, 766 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns,
762 -m_tiler->tileSize().height() * prepaintRows); 767 -m_tiler->tileSize().height() * prepaintRows);
763 gfx::Rect contentRect(gfx::Point(), contentBounds()); 768 gfx::Rect contentRect(gfx::Point(), contentBounds());
764 prepaintRect.Intersect(contentRect); 769 prepaintRect.Intersect(contentRect);
765 770
766 return prepaintRect; 771 return prepaintRect;
767 } 772 }
768 773
769 } // namespace cc 774 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_unittest_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698