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

Side by Side Diff: cc/test/mock_occlusion_tracker.h

Issue 1533773002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@cl-2e
Patch Set: rebase Created 5 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
« no previous file with comments | « cc/test/impl_side_painting_settings.h ('k') | cc/test/ordered_simple_task_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_TEST_MOCK_OCCLUSION_TRACKER_H_
6 #define CC_TEST_MOCK_OCCLUSION_TRACKER_H_
7
8 #include "cc/trees/occlusion_tracker.h"
9
10 namespace cc {
11
12 template <typename LayerType>
13 class MockOcclusionTracker : public OcclusionTracker<LayerType> {
14 // This class is used for testing only. It fakes just enough information to
15 // calculate unoccluded content rect and unoccluded contributing surface
16 // content rect. It calls the helper function of occlusion tracker to avoid
17 // DCHECKs since testing environment won't be set up properly to pass those.
18 public:
19 MockOcclusionTracker()
20 : OcclusionTracker<LayerType>(gfx::Rect(0, 0, 1000, 1000)) {
21 typename OcclusionTracker<LayerType>::StackObject stack_obj;
22 OcclusionTracker<LayerType>::stack_.push_back(stack_obj);
23 OcclusionTracker<LayerType>::stack_.push_back(stack_obj);
24 }
25
26 explicit MockOcclusionTracker(const gfx::Rect& screen_scissor_rect)
27 : OcclusionTracker<LayerType>(screen_scissor_rect) {
28 typename OcclusionTracker<LayerType>::StackObject stack_obj;
29 OcclusionTracker<LayerType>::stack_.push_back(stack_obj);
30 OcclusionTracker<LayerType>::stack_.push_back(stack_obj);
31 }
32
33 void set_occluded_target_rect(const gfx::Rect& occluded) {
34 OcclusionTracker<LayerType>::stack_.back().occlusion_from_inside_target =
35 occluded;
36 }
37
38 void set_occluded_target_rect_for_contributing_surface(
39 const gfx::Rect& occluded) {
40 OcclusionTracker<
41 LayerType>::stack_[OcclusionTracker<LayerType>::stack_.size() - 2]
42 .occlusion_from_inside_target = occluded;
43 }
44
45 private:
46 DISALLOW_COPY_AND_ASSIGN(MockOcclusionTracker);
47 };
48
49 } // namespace cc
50
51 #endif // CC_TEST_MOCK_OCCLUSION_TRACKER_H_
OLDNEW
« no previous file with comments | « cc/test/impl_side_painting_settings.h ('k') | cc/test/ordered_simple_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698