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

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

Issue 304203005: Remove const LayerImpl* from QuadSink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onlyQuadSink
Patch Set: Created 6 years, 6 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
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 #ifndef CC_TEST_MOCK_QUAD_CULLER_H_ 5 #ifndef CC_TEST_MOCK_QUAD_CULLER_H_
6 #define CC_TEST_MOCK_QUAD_CULLER_H_ 6 #define CC_TEST_MOCK_QUAD_CULLER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
11 #include "cc/quads/render_pass.h" 11 #include "cc/quads/render_pass.h"
12 #include "cc/test/mock_occlusion_tracker.h" 12 #include "cc/test/mock_occlusion_tracker.h"
13 13
14 namespace cc { 14 namespace cc {
15 class LayerImpl; 15 class LayerImpl;
16 16
17 class MockQuadCuller : public QuadSink { 17 class MockQuadCuller : public QuadSink {
18 public: 18 public:
19 virtual ~MockQuadCuller(); 19 virtual ~MockQuadCuller();
20 20
21 MockQuadCuller(RenderPass* render_pass, 21 MockQuadCuller(RenderPass* render_pass,
22 MockOcclusionTracker<LayerImpl>* occlusion_tracker); 22 MockOcclusionTracker<LayerImpl>* occlusion_tracker);
23 23
24 virtual gfx::Rect UnoccludedContentRect( 24 virtual gfx::Rect UnoccludedContentRect(
25 const LayerImpl* layer,
25 const gfx::Rect& content_rect, 26 const gfx::Rect& content_rect,
26 const gfx::Transform& draw_transform) OVERRIDE; 27 const gfx::Transform& draw_transform) OVERRIDE;
27 28
28 virtual gfx::Rect UnoccludedContributingSurfaceContentRect( 29 virtual gfx::Rect UnoccludedContributingSurfaceContentRect(
30 const LayerImpl* layer,
29 const gfx::Rect& content_rect, 31 const gfx::Rect& content_rect,
30 const gfx::Transform& draw_transform) OVERRIDE; 32 const gfx::Transform& draw_transform) OVERRIDE;
31 33
32 const QuadList& quad_list() const { return render_pass_->quad_list; } 34 const QuadList& quad_list() const { return render_pass_->quad_list; }
33 const SharedQuadStateList& shared_quad_state_list() const { 35 const SharedQuadStateList& shared_quad_state_list() const {
34 return render_pass_->shared_quad_state_list; 36 return render_pass_->shared_quad_state_list;
35 } 37 }
36 38
37 void set_occluded_target_rect(const gfx::Rect& occluded) { 39 void set_occluded_target_rect(const gfx::Rect& occluded) {
38 occlusion_tracker_->set_occluded_target_rect(occluded); 40 occlusion_tracker_->set_occluded_target_rect(occluded);
39 } 41 }
40 42
41 void set_occluded_target_rect_for_contributing_surface( 43 void set_occluded_target_rect_for_contributing_surface(
42 const gfx::Rect& occluded) { 44 const gfx::Rect& occluded) {
43 occlusion_tracker_->set_occluded_target_rect_for_contributing_surface( 45 occlusion_tracker_->set_occluded_target_rect_for_contributing_surface(
44 occluded); 46 occluded);
45 } 47 }
46 48
47 void set_layer(const LayerImpl* layer) { layer_ = layer; }
48
49 void clear_lists() { 49 void clear_lists() {
50 render_pass_->quad_list.clear(); 50 render_pass_->quad_list.clear();
51 render_pass_->shared_quad_state_list.clear(); 51 render_pass_->shared_quad_state_list.clear();
52 } 52 }
53 53
54 private: 54 private:
55 MockOcclusionTracker<LayerImpl>* occlusion_tracker_; 55 MockOcclusionTracker<LayerImpl>* occlusion_tracker_;
56 }; 56 };
57 57
58 } // namespace cc 58 } // namespace cc
59 59
60 #endif // CC_TEST_MOCK_QUAD_CULLER_H_ 60 #endif // CC_TEST_MOCK_QUAD_CULLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698