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

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

Issue 202523002: cc: Replace Region with SimpleEnclosedRegion for occlusion tracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpleregion: . Created 6 years, 4 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
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"
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "cc/base/simple_enclosed_region.h"
13 #include "cc/layers/layer_impl.h" 14 #include "cc/layers/layer_impl.h"
14 #include "cc/layers/tiled_layer_impl.h" 15 #include "cc/layers/tiled_layer_impl.h"
15 #include "cc/resources/layer_updater.h" 16 #include "cc/resources/layer_updater.h"
16 #include "cc/resources/prioritized_resource.h" 17 #include "cc/resources/prioritized_resource.h"
17 #include "cc/resources/priority_calculator.h" 18 #include "cc/resources/priority_calculator.h"
18 #include "cc/trees/layer_tree_host.h" 19 #include "cc/trees/layer_tree_host.h"
19 #include "cc/trees/occlusion_tracker.h" 20 #include "cc/trees/occlusion_tracker.h"
20 #include "third_party/khronos/GLES2/gl2.h" 21 #include "third_party/khronos/GLES2/gl2.h"
21 #include "ui/gfx/rect_conversions.h" 22 #include "ui/gfx/rect_conversions.h"
22 23
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 continue; 633 continue;
633 gfx::Rect tile_rect = tiler_->TileRect(tile); 634 gfx::Rect tile_rect = tiler_->TileRect(tile);
634 SetPriorityForTexture(predicted_visible_rect_, 635 SetPriorityForTexture(predicted_visible_rect_,
635 tile_rect, 636 tile_rect,
636 draws_to_root, 637 draws_to_root,
637 small_animated_layer, 638 small_animated_layer,
638 tile->managed_resource()); 639 tile->managed_resource());
639 } 640 }
640 } 641 }
641 642
642 Region TiledLayer::VisibleContentOpaqueRegion() const { 643 SimpleEnclosedRegion TiledLayer::VisibleContentOpaqueRegion() const {
643 if (skips_draw_) 644 if (skips_draw_)
644 return Region(); 645 return SimpleEnclosedRegion();
645 if (contents_opaque()) 646 if (contents_opaque())
646 return visible_content_rect(); 647 return SimpleEnclosedRegion(visible_content_rect());
647 return tiler_->OpaqueRegionInContentRect(visible_content_rect()); 648 return tiler_->OpaqueRegionInContentRect(visible_content_rect());
648 } 649 }
649 650
650 void TiledLayer::ResetUpdateState() { 651 void TiledLayer::ResetUpdateState() {
651 skips_draw_ = false; 652 skips_draw_ = false;
652 failed_update_ = false; 653 failed_update_ = false;
653 654
654 LayerTilingData::TileMap::const_iterator end = tiler_->tiles().end(); 655 LayerTilingData::TileMap::const_iterator end = tiler_->tiles().end();
655 for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin(); 656 for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin();
656 iter != end; 657 iter != end;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 gfx::Rect prepaint_rect = visible_content_rect(); 892 gfx::Rect prepaint_rect = visible_content_rect();
892 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, 893 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns,
893 -tiler_->tile_size().height() * kPrepaintRows); 894 -tiler_->tile_size().height() * kPrepaintRows);
894 gfx::Rect content_rect(content_bounds()); 895 gfx::Rect content_rect(content_bounds());
895 prepaint_rect.Intersect(content_rect); 896 prepaint_rect.Intersect(content_rect);
896 897
897 return prepaint_rect; 898 return prepaint_rect;
898 } 899 }
899 900
900 } // namespace cc 901 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698