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

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

Issue 202763002: Switch to use SharedBitmapManager all the time in cc_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.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/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/layers/content_layer.h" 8 #include "cc/layers/content_layer.h"
9 #include "cc/layers/delegated_frame_provider.h" 9 #include "cc/layers/delegated_frame_provider.h"
10 #include "cc/layers/delegated_frame_resource_collection.h" 10 #include "cc/layers/delegated_frame_resource_collection.h"
(...skipping 15 matching lines...) Expand all
26 #include "cc/test/fake_layer_tree_host_client.h" 26 #include "cc/test/fake_layer_tree_host_client.h"
27 #include "cc/test/fake_output_surface.h" 27 #include "cc/test/fake_output_surface.h"
28 #include "cc/test/fake_output_surface_client.h" 28 #include "cc/test/fake_output_surface_client.h"
29 #include "cc/test/fake_painted_scrollbar_layer.h" 29 #include "cc/test/fake_painted_scrollbar_layer.h"
30 #include "cc/test/fake_scoped_ui_resource.h" 30 #include "cc/test/fake_scoped_ui_resource.h"
31 #include "cc/test/fake_scrollbar.h" 31 #include "cc/test/fake_scrollbar.h"
32 #include "cc/test/fake_video_frame_provider.h" 32 #include "cc/test/fake_video_frame_provider.h"
33 #include "cc/test/layer_tree_test.h" 33 #include "cc/test/layer_tree_test.h"
34 #include "cc/test/render_pass_test_common.h" 34 #include "cc/test/render_pass_test_common.h"
35 #include "cc/test/test_context_provider.h" 35 #include "cc/test/test_context_provider.h"
36 #include "cc/test/test_shared_bitmap_manager.h"
36 #include "cc/test/test_web_graphics_context_3d.h" 37 #include "cc/test/test_web_graphics_context_3d.h"
37 #include "cc/trees/layer_tree_host_impl.h" 38 #include "cc/trees/layer_tree_host_impl.h"
38 #include "cc/trees/layer_tree_impl.h" 39 #include "cc/trees/layer_tree_impl.h"
39 #include "cc/trees/single_thread_proxy.h" 40 #include "cc/trees/single_thread_proxy.h"
40 #include "gpu/GLES2/gl2extchromium.h" 41 #include "gpu/GLES2/gl2extchromium.h"
41 #include "media/base/media.h" 42 #include "media/base/media.h"
42 43
43 using media::VideoFrame; 44 using media::VideoFrame;
44 45
45 namespace cc { 46 namespace cc {
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestLayersNotified); 927 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestLayersNotified);
927 928
928 class LayerTreeHostContextTestDontUseLostResources 929 class LayerTreeHostContextTestDontUseLostResources
929 : public LayerTreeHostContextTest { 930 : public LayerTreeHostContextTest {
930 public: 931 public:
931 LayerTreeHostContextTestDontUseLostResources() : lost_context_(false) { 932 LayerTreeHostContextTestDontUseLostResources() : lost_context_(false) {
932 context_should_support_io_surface_ = true; 933 context_should_support_io_surface_ = true;
933 934
934 child_output_surface_ = FakeOutputSurface::Create3d(); 935 child_output_surface_ = FakeOutputSurface::Create3d();
935 child_output_surface_->BindToClient(&output_surface_client_); 936 child_output_surface_->BindToClient(&output_surface_client_);
937 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
936 child_resource_provider_ = ResourceProvider::Create( 938 child_resource_provider_ = ResourceProvider::Create(
937 child_output_surface_.get(), NULL, 0, false, 1); 939 child_output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1);
938 } 940 }
939 941
940 static void EmptyReleaseCallback(unsigned sync_point, bool lost) {} 942 static void EmptyReleaseCallback(unsigned sync_point, bool lost) {}
941 943
942 virtual void SetupTree() OVERRIDE { 944 virtual void SetupTree() OVERRIDE {
943 gpu::gles2::GLES2Interface* gl = 945 gpu::gles2::GLES2Interface* gl =
944 child_output_surface_->context_provider()->ContextGL(); 946 child_output_surface_->context_provider()->ContextGL();
945 947
946 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); 948 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
947 949
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 } 1146 }
1145 1147
1146 virtual void AfterTest() OVERRIDE { EXPECT_TRUE(lost_context_); } 1148 virtual void AfterTest() OVERRIDE { EXPECT_TRUE(lost_context_); }
1147 1149
1148 private: 1150 private:
1149 FakeContentLayerClient client_; 1151 FakeContentLayerClient client_;
1150 bool lost_context_; 1152 bool lost_context_;
1151 1153
1152 FakeOutputSurfaceClient output_surface_client_; 1154 FakeOutputSurfaceClient output_surface_client_;
1153 scoped_ptr<FakeOutputSurface> child_output_surface_; 1155 scoped_ptr<FakeOutputSurface> child_output_surface_;
1156 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
1154 scoped_ptr<ResourceProvider> child_resource_provider_; 1157 scoped_ptr<ResourceProvider> child_resource_provider_;
1155 1158
1156 scoped_refptr<DelegatedFrameResourceCollection> 1159 scoped_refptr<DelegatedFrameResourceCollection>
1157 delegated_resource_collection_; 1160 delegated_resource_collection_;
1158 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; 1161 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_;
1159 1162
1160 scoped_refptr<VideoFrame> color_video_frame_; 1163 scoped_refptr<VideoFrame> color_video_frame_;
1161 scoped_refptr<VideoFrame> hw_video_frame_; 1164 scoped_refptr<VideoFrame> hw_video_frame_;
1162 scoped_refptr<VideoFrame> scaled_hw_video_frame_; 1165 scoped_refptr<VideoFrame> scaled_hw_video_frame_;
1163 1166
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 1979
1977 protected: 1980 protected:
1978 FakeContentLayerClient client_; 1981 FakeContentLayerClient client_;
1979 scoped_refptr<FakeContentLayer> layer_; 1982 scoped_refptr<FakeContentLayer> layer_;
1980 }; 1983 };
1981 1984
1982 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); 1985 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback);
1983 1986
1984 } // namespace 1987 } // namespace
1985 } // namespace cc 1988 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698