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

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

Issue 2855723002: Don't submit frames with no render passes in cc tests (Closed)
Patch Set: c Created 3 years, 7 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/test/compositor_frame_helpers.cc ('k') | cc/test/fake_compositor_frame_sink.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 #ifndef CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ 5 #ifndef CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_
6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ 6 #define CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); } 69 CompositorFrame* last_sent_frame() { return last_sent_frame_.get(); }
70 size_t num_sent_frames() { return num_sent_frames_; } 70 size_t num_sent_frames() { return num_sent_frames_; }
71 71
72 CompositorFrameSinkClient* client() { return client_; } 72 CompositorFrameSinkClient* client() { return client_; }
73 73
74 const TransferableResourceArray& resources_held_by_parent() { 74 const TransferableResourceArray& resources_held_by_parent() {
75 return resources_held_by_parent_; 75 return resources_held_by_parent_;
76 } 76 }
77 77
78 gfx::Rect last_swap_rect() const { 78 gfx::Rect last_swap_rect() const {
79 DCHECK(last_swap_rect_valid_);
80 return last_swap_rect_; 79 return last_swap_rect_;
81 } 80 }
82 81
83 void ReturnResourcesHeldByParent(); 82 void ReturnResourcesHeldByParent();
84 83
85 protected: 84 protected:
86 FakeCompositorFrameSink( 85 FakeCompositorFrameSink(
87 scoped_refptr<ContextProvider> context_provider, 86 scoped_refptr<ContextProvider> context_provider,
88 scoped_refptr<ContextProvider> worker_context_provider); 87 scoped_refptr<ContextProvider> worker_context_provider);
89 88
90 TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; 89 TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_;
91 TestSharedBitmapManager test_shared_bitmap_manager_; 90 TestSharedBitmapManager test_shared_bitmap_manager_;
92 91
93 std::unique_ptr<CompositorFrame> last_sent_frame_; 92 std::unique_ptr<CompositorFrame> last_sent_frame_;
94 size_t num_sent_frames_ = 0; 93 size_t num_sent_frames_ = 0;
95 TransferableResourceArray resources_held_by_parent_; 94 TransferableResourceArray resources_held_by_parent_;
96 bool last_swap_rect_valid_ = false;
97 gfx::Rect last_swap_rect_; 95 gfx::Rect last_swap_rect_;
98 96
99 private: 97 private:
100 void DidReceiveCompositorFrameAck(); 98 void DidReceiveCompositorFrameAck();
101 99
102 std::unique_ptr<BeginFrameSource> begin_frame_source_; 100 std::unique_ptr<BeginFrameSource> begin_frame_source_;
103 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_; 101 base::WeakPtrFactory<FakeCompositorFrameSink> weak_ptr_factory_;
104 }; 102 };
105 103
106 } // namespace cc 104 } // namespace cc
107 105
108 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_ 106 #endif // CC_TEST_FAKE_COMPOSITOR_FRAME_SINK_H_
OLDNEW
« no previous file with comments | « cc/test/compositor_frame_helpers.cc ('k') | cc/test/fake_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698