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

Side by Side Diff: cc/test/fake_picture_layer.cc

Issue 2688673003: cc: Distinguish single texture mask from normal masks (Closed)
Patch Set: Rebase Created 3 years, 10 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/layers/picture_layer_impl.cc ('k') | cc/test/fake_picture_layer_impl.h » ('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/test/fake_picture_layer.h" 5 #include "cc/test/fake_picture_layer.h"
6 6
7 #include "cc/test/fake_picture_layer_impl.h" 7 #include "cc/test/fake_picture_layer_impl.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 13 matching lines...) Expand all
24 always_update_resources_(false), 24 always_update_resources_(false),
25 force_unsuitable_for_gpu_rasterization_(false) { 25 force_unsuitable_for_gpu_rasterization_(false) {
26 SetBounds(gfx::Size(1, 1)); 26 SetBounds(gfx::Size(1, 1));
27 SetIsDrawable(true); 27 SetIsDrawable(true);
28 } 28 }
29 29
30 FakePictureLayer::~FakePictureLayer() {} 30 FakePictureLayer::~FakePictureLayer() {}
31 31
32 std::unique_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl( 32 std::unique_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl(
33 LayerTreeImpl* tree_impl) { 33 LayerTreeImpl* tree_impl) {
34 if (is_mask()) 34 switch (mask_type()) {
35 return FakePictureLayerImpl::CreateMask(tree_impl, id()); 35 case Layer::LayerMaskType::NOT_MASK:
36 return FakePictureLayerImpl::Create(tree_impl, id()); 36 return FakePictureLayerImpl::Create(tree_impl, id());
37 case Layer::LayerMaskType::MULTI_TEXTURE_MASK:
38 return FakePictureLayerImpl::CreateMask(tree_impl, id());
39 case Layer::LayerMaskType::SINGLE_TEXTURE_MASK:
40 return FakePictureLayerImpl::CreateSingleTextureMask(tree_impl, id());
41 default:
42 NOTREACHED();
43 break;
44 }
45 return nullptr;
37 } 46 }
38 47
39 bool FakePictureLayer::Update() { 48 bool FakePictureLayer::Update() {
40 bool updated = PictureLayer::Update(); 49 bool updated = PictureLayer::Update();
41 update_count_++; 50 update_count_++;
42 return updated || always_update_resources_; 51 return updated || always_update_resources_;
43 } 52 }
44 53
45 bool FakePictureLayer::IsSuitableForGpuRasterization() const { 54 bool FakePictureLayer::IsSuitableForGpuRasterization() const {
46 if (force_unsuitable_for_gpu_rasterization_) 55 if (force_unsuitable_for_gpu_rasterization_)
47 return false; 56 return false;
48 return PictureLayer::IsSuitableForGpuRasterization(); 57 return PictureLayer::IsSuitableForGpuRasterization();
49 } 58 }
50 59
51 } // namespace cc 60 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/test/fake_picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698