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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 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/trees/layer_tree_host_pixeltest_tiles.cc ('k') | chrome/browser/download/download_shelf.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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/layers/heads_up_display_layer.h" 9 #include "cc/layers/heads_up_display_layer.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 // This test uses PictureLayer to check for a working context. 602 // This test uses PictureLayer to check for a working context.
603 class LayerTreeHostContextTestLostContextSucceedsWithContent 603 class LayerTreeHostContextTestLostContextSucceedsWithContent
604 : public LayerTreeHostContextTestLostContextSucceeds { 604 : public LayerTreeHostContextTestLostContextSucceeds {
605 public: 605 public:
606 void SetupTree() override { 606 void SetupTree() override {
607 root_ = Layer::Create(); 607 root_ = Layer::Create();
608 root_->SetBounds(gfx::Size(10, 10)); 608 root_->SetBounds(gfx::Size(10, 10));
609 root_->SetIsDrawable(true); 609 root_->SetIsDrawable(true);
610 610
611 // Paint non-solid color. 611 // Paint non-solid color.
612 SkPaint paint; 612 CdlPaint paint;
613 paint.setColor(SkColorSetARGB(100, 80, 200, 200)); 613 paint.setColor(SkColorSetARGB(100, 80, 200, 200));
614 client_.add_draw_rect(gfx::Rect(5, 5), paint); 614 client_.add_draw_rect(gfx::Rect(5, 5), paint);
615 615
616 layer_ = FakePictureLayer::Create(&client_); 616 layer_ = FakePictureLayer::Create(&client_);
617 layer_->SetBounds(gfx::Size(10, 10)); 617 layer_->SetBounds(gfx::Size(10, 10));
618 layer_->SetIsDrawable(true); 618 layer_->SetIsDrawable(true);
619 619
620 root_->AddChild(layer_); 620 root_->AddChild(layer_);
621 621
622 layer_tree()->SetRootLayer(root_); 622 layer_tree()->SetRootLayer(root_);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 : public LayerTreeHostContextTest { 681 : public LayerTreeHostContextTest {
682 public: 682 public:
683 LayerTreeHostContextTestLostContextAndEvictTextures() 683 LayerTreeHostContextTestLostContextAndEvictTextures()
684 : LayerTreeHostContextTest(), 684 : LayerTreeHostContextTest(),
685 impl_host_(0), 685 impl_host_(0),
686 num_commits_(0), 686 num_commits_(0),
687 lost_context_(false) {} 687 lost_context_(false) {}
688 688
689 void SetupTree() override { 689 void SetupTree() override {
690 // Paint non-solid color. 690 // Paint non-solid color.
691 SkPaint paint; 691 CdlPaint paint;
692 paint.setColor(SkColorSetARGB(100, 80, 200, 200)); 692 paint.setColor(SkColorSetARGB(100, 80, 200, 200));
693 client_.add_draw_rect(gfx::Rect(5, 5), paint); 693 client_.add_draw_rect(gfx::Rect(5, 5), paint);
694 694
695 scoped_refptr<FakePictureLayer> picture_layer = 695 scoped_refptr<FakePictureLayer> picture_layer =
696 FakePictureLayer::Create(&client_); 696 FakePictureLayer::Create(&client_);
697 picture_layer->SetBounds(gfx::Size(10, 20)); 697 picture_layer->SetBounds(gfx::Size(10, 20));
698 client_.set_bounds(picture_layer->bounds()); 698 client_.set_bounds(picture_layer->bounds());
699 layer_tree()->SetRootLayer(picture_layer); 699 layer_tree()->SetRootLayer(picture_layer);
700 700
701 LayerTreeHostContextTest::SetupTree(); 701 LayerTreeHostContextTest::SetupTree();
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 SINGLE_AND_MULTI_THREAD_TEST_F( 1595 SINGLE_AND_MULTI_THREAD_TEST_F(
1596 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1596 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1597 1597
1598 // This test causes context loss on the worker context but not the compositor 1598 // This test causes context loss on the worker context but not the compositor
1599 // context and checks that draw still occurs. The resources might be in a bad 1599 // context and checks that draw still occurs. The resources might be in a bad
1600 // state e.g. null sync tokens but that shouldn't cause the draw to fail. 1600 // state e.g. null sync tokens but that shouldn't cause the draw to fail.
1601 class LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles 1601 class LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles
1602 : public LayerTreeTest { 1602 : public LayerTreeTest {
1603 protected: 1603 protected:
1604 void SetupTree() override { 1604 void SetupTree() override {
1605 SkPaint paint; 1605 CdlPaint paint;
1606 client_.set_fill_with_nonsolid_color(true); 1606 client_.set_fill_with_nonsolid_color(true);
1607 client_.add_draw_rect(gfx::Rect(5, 5), paint); 1607 client_.add_draw_rect(gfx::Rect(5, 5), paint);
1608 1608
1609 scoped_refptr<FakePictureLayer> picture_layer = 1609 scoped_refptr<FakePictureLayer> picture_layer =
1610 FakePictureLayer::Create(&client_); 1610 FakePictureLayer::Create(&client_);
1611 picture_layer->SetBounds(gfx::Size(10, 20)); 1611 picture_layer->SetBounds(gfx::Size(10, 20));
1612 client_.set_bounds(picture_layer->bounds()); 1612 client_.set_bounds(picture_layer->bounds());
1613 layer_tree()->SetRootLayer(picture_layer); 1613 layer_tree()->SetRootLayer(picture_layer);
1614 1614
1615 LayerTreeTest::SetupTree(); 1615 LayerTreeTest::SetupTree();
(...skipping 19 matching lines...) Expand all
1635 1635
1636 FakeContentLayerClient client_; 1636 FakeContentLayerClient client_;
1637 int num_draws_ = 0; 1637 int num_draws_ = 0;
1638 }; 1638 };
1639 1639
1640 MULTI_THREAD_TEST_F( 1640 MULTI_THREAD_TEST_F(
1641 LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles); 1641 LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles);
1642 1642
1643 } // namespace 1643 } // namespace
1644 } // namespace cc 1644 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_tiles.cc ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698