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

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

Issue 917763003: cc: Move occlusion debug rects into the debug layer borders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: occlusiondebugrects: reviewed Created 5 years, 10 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 | « cc/trees/occlusion_tracker.cc ('k') | chrome/browser/chromeos/login/chrome_restart_request.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 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/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include "cc/animation/layer_animation_controller.h" 7 #include "cc/animation/layer_animation_controller.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 gfx::Rect UnoccludedLayerContentRect(const LayerType* layer, 94 gfx::Rect UnoccludedLayerContentRect(const LayerType* layer,
95 const gfx::Rect& content_rect) const { 95 const gfx::Rect& content_rect) const {
96 DCHECK(layer->visible_content_rect().Contains(content_rect)); 96 DCHECK(layer->visible_content_rect().Contains(content_rect));
97 return this->GetCurrentOcclusionForLayer(layer->draw_transform()) 97 return this->GetCurrentOcclusionForLayer(layer->draw_transform())
98 .GetUnoccludedContentRect(content_rect); 98 .GetUnoccludedContentRect(content_rect);
99 } 99 }
100 100
101 gfx::Rect UnoccludedSurfaceContentRect(const LayerType* layer, 101 gfx::Rect UnoccludedSurfaceContentRect(const LayerType* layer,
102 const gfx::Rect& content_rect) const { 102 const gfx::Rect& content_rect) const {
103 typename LayerType::RenderSurfaceType* surface = layer->render_surface(); 103 typename LayerType::RenderSurfaceType* surface = layer->render_surface();
104 return this->UnoccludedContributingSurfaceContentRect( 104 return this->GetCurrentOcclusionForContributingSurface(
105 content_rect, surface->draw_transform()); 105 surface->draw_transform())
106 .GetUnoccludedContentRect(content_rect);
106 } 107 }
107 }; 108 };
108 109
109 struct OcclusionTrackerTestMainThreadTypes { 110 struct OcclusionTrackerTestMainThreadTypes {
110 typedef Layer LayerType; 111 typedef Layer LayerType;
111 typedef FakeLayerTreeHost HostType; 112 typedef FakeLayerTreeHost HostType;
112 typedef RenderSurface RenderSurfaceType; 113 typedef RenderSurface RenderSurfaceType;
113 typedef TestContentLayer ContentLayerType; 114 typedef TestContentLayer ContentLayerType;
114 typedef scoped_refptr<Layer> LayerPtrType; 115 typedef scoped_refptr<Layer> LayerPtrType;
115 typedef scoped_refptr<ContentLayerType> ContentLayerPtrType; 116 typedef scoped_refptr<ContentLayerType> ContentLayerPtrType;
(...skipping 3199 matching lines...) Expand 10 before | Expand all | Expand 10 after
3315 EXPECT_EQ(gfx::Rect(), 3316 EXPECT_EQ(gfx::Rect(),
3316 occlusion.UnoccludedSurfaceContentRect( 3317 occlusion.UnoccludedSurfaceContentRect(
3317 surface, gfx::Rect(80, 70, 50, 50))); 3318 surface, gfx::Rect(80, 70, 50, 50)));
3318 } 3319 }
3319 }; 3320 };
3320 3321
3321 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 3322 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
3322 3323
3323 } // namespace 3324 } // namespace
3324 } // namespace cc 3325 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker.cc ('k') | chrome/browser/chromeos/login/chrome_restart_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698