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

Side by Side Diff: cc/layer_tree_host_unittest_context.cc

Issue 12041012: cc: Chromium-stylify the DelegatedRendererLayer classes and tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
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/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/content_layer.h" 8 #include "cc/content_layer.h"
9 #include "cc/delegated_renderer_layer.h" 9 #include "cc/delegated_renderer_layer.h"
10 #include "cc/delegated_renderer_layer_impl.h" 10 #include "cc/delegated_renderer_layer_impl.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 virtual void setupTree() OVERRIDE { 576 virtual void setupTree() OVERRIDE {
577 context3d_->set_have_extension_io_surface(true); 577 context3d_->set_have_extension_io_surface(true);
578 context3d_->set_have_extension_egl_image(true); 578 context3d_->set_have_extension_egl_image(true);
579 579
580 scoped_refptr<Layer> root_ = Layer::create(); 580 scoped_refptr<Layer> root_ = Layer::create();
581 root_->setBounds(gfx::Size(10, 10)); 581 root_->setBounds(gfx::Size(10, 10));
582 root_->setAnchorPoint(gfx::PointF()); 582 root_->setAnchorPoint(gfx::PointF());
583 root_->setIsDrawable(true); 583 root_->setIsDrawable(true);
584 584
585 scoped_refptr<DelegatedRendererLayer> delegated_ = 585 scoped_refptr<DelegatedRendererLayer> delegated_ =
586 DelegatedRendererLayer::create(); 586 DelegatedRendererLayer::Create();
587 delegated_->setBounds(gfx::Size(10, 10)); 587 delegated_->setBounds(gfx::Size(10, 10));
588 delegated_->setAnchorPoint(gfx::PointF()); 588 delegated_->setAnchorPoint(gfx::PointF());
589 delegated_->setIsDrawable(true); 589 delegated_->setIsDrawable(true);
590 root_->addChild(delegated_); 590 root_->addChild(delegated_);
591 591
592 scoped_refptr<ContentLayer> content_ = ContentLayer::create(&client_); 592 scoped_refptr<ContentLayer> content_ = ContentLayer::create(&client_);
593 content_->setBounds(gfx::Size(10, 10)); 593 content_->setBounds(gfx::Size(10, 10));
594 content_->setAnchorPoint(gfx::PointF()); 594 content_->setAnchorPoint(gfx::PointF());
595 content_->setIsDrawable(true); 595 content_->setIsDrawable(true);
596 root_->addChild(content_); 596 root_->addChild(content_);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 pass->AppendOneOfEveryQuadType(resource_provider, RenderPass::Id(2, 1)); 697 pass->AppendOneOfEveryQuadType(resource_provider, RenderPass::Id(2, 1));
698 698
699 ScopedPtrVector<RenderPass> pass_list; 699 ScopedPtrVector<RenderPass> pass_list;
700 pass_list.push_back(pass_for_quad.PassAs<RenderPass>()); 700 pass_list.push_back(pass_for_quad.PassAs<RenderPass>());
701 pass_list.push_back(pass.PassAs<RenderPass>()); 701 pass_list.push_back(pass.PassAs<RenderPass>());
702 702
703 // First child is the delegated layer. 703 // First child is the delegated layer.
704 DelegatedRendererLayerImpl* delegated_impl = 704 DelegatedRendererLayerImpl* delegated_impl =
705 static_cast<DelegatedRendererLayerImpl*>( 705 static_cast<DelegatedRendererLayerImpl*>(
706 host_impl->rootLayer()->children()[0]); 706 host_impl->rootLayer()->children()[0]);
707 delegated_impl->setRenderPasses(pass_list); 707 delegated_impl->SetRenderPasses(pass_list);
708 EXPECT_TRUE(pass_list.empty()); 708 EXPECT_TRUE(pass_list.empty());
709 709
710 color_video_frame_ = VideoFrame::CreateColorFrame( 710 color_video_frame_ = VideoFrame::CreateColorFrame(
711 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); 711 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
712 hw_video_frame_ = VideoFrame::WrapNativeTexture( 712 hw_video_frame_ = VideoFrame::WrapNativeTexture(
713 resource_provider->graphicsContext3D()->createTexture(), 713 resource_provider->graphicsContext3D()->createTexture(),
714 GL_TEXTURE_2D, 714 GL_TEXTURE_2D,
715 gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), 715 gfx::Size(4, 4), gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4),
716 base::TimeDelta(), 716 base::TimeDelta(),
717 VideoFrame::ReadPixelsCB(), 717 VideoFrame::ReadPixelsCB(),
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 908
909 private: 909 private:
910 int commits_; 910 int commits_;
911 scoped_refptr<FakeScrollbarLayer> scrollbar_layer_; 911 scoped_refptr<FakeScrollbarLayer> scrollbar_layer_;
912 }; 912 };
913 913
914 SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext) 914 SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext)
915 915
916 } // namespace 916 } // namespace
917 } // namespace cc 917 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698