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

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

Issue 2688673003: cc: Distinguish single texture mask from normal masks (Closed)
Patch Set: 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_impl.h" 5 #include "cc/test/fake_picture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "cc/tiles/tile.h" 12 #include "cc/tiles/tile.h"
13 #include "cc/trees/layer_tree_impl.h" 13 #include "cc/trees/layer_tree_impl.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 FakePictureLayerImpl::FakePictureLayerImpl( 17 FakePictureLayerImpl::FakePictureLayerImpl(
18 LayerTreeImpl* tree_impl, 18 LayerTreeImpl* tree_impl,
19 int id, 19 int id,
20 scoped_refptr<RasterSource> raster_source, 20 scoped_refptr<RasterSource> raster_source,
21 bool is_mask) 21 bool is_mask,
22 : PictureLayerImpl(tree_impl, id, is_mask) { 22 bool is_single_texture_mask)
23 : PictureLayerImpl(tree_impl, id, is_mask, is_single_texture_mask) {
23 SetBounds(raster_source->GetSize()); 24 SetBounds(raster_source->GetSize());
24 SetRasterSourceOnPending(raster_source, Region()); 25 SetRasterSourceOnPending(raster_source, Region());
25 } 26 }
26 27
27 FakePictureLayerImpl::FakePictureLayerImpl( 28 FakePictureLayerImpl::FakePictureLayerImpl(
28 LayerTreeImpl* tree_impl, 29 LayerTreeImpl* tree_impl,
29 int id, 30 int id,
30 scoped_refptr<RasterSource> raster_source, 31 scoped_refptr<RasterSource> raster_source,
31 bool is_mask, 32 bool is_mask,
33 bool is_single_texture_mask,
32 const gfx::Size& layer_bounds) 34 const gfx::Size& layer_bounds)
33 : PictureLayerImpl(tree_impl, id, is_mask) { 35 : PictureLayerImpl(tree_impl, id, is_mask, is_single_texture_mask) {
34 SetBounds(layer_bounds); 36 SetBounds(layer_bounds);
35 SetRasterSourceOnPending(raster_source, Region()); 37 SetRasterSourceOnPending(raster_source, Region());
36 } 38 }
37 39
38 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, 40 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl,
39 int id, 41 int id,
40 bool is_mask) 42 bool is_mask,
41 : PictureLayerImpl(tree_impl, id, is_mask) {} 43 bool is_single_texture_mask)
44 : PictureLayerImpl(tree_impl, id, is_mask, is_single_texture_mask) {}
42 45
43 std::unique_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( 46 std::unique_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl(
44 LayerTreeImpl* tree_impl) { 47 LayerTreeImpl* tree_impl) {
45 return base::WrapUnique(new FakePictureLayerImpl(tree_impl, id(), is_mask_)); 48 return base::WrapUnique(new FakePictureLayerImpl(tree_impl, id(), is_mask_,
49 is_single_texture_mask_));
46 } 50 }
47 51
48 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { 52 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) {
49 FakePictureLayerImpl* picture_layer_impl = 53 FakePictureLayerImpl* picture_layer_impl =
50 static_cast<FakePictureLayerImpl*>(layer_impl); 54 static_cast<FakePictureLayerImpl*>(layer_impl);
51 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; 55 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_;
52 PictureLayerImpl::PushPropertiesTo(layer_impl); 56 PictureLayerImpl::PushPropertiesTo(layer_impl);
53 } 57 }
54 58
55 void FakePictureLayerImpl::AppendQuads( 59 void FakePictureLayerImpl::AppendQuads(
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 PictureLayerImpl::ReleaseResources(); 208 PictureLayerImpl::ReleaseResources();
205 ++release_resources_count_; 209 ++release_resources_count_;
206 } 210 }
207 211
208 void FakePictureLayerImpl::ReleaseTileResources() { 212 void FakePictureLayerImpl::ReleaseTileResources() {
209 PictureLayerImpl::ReleaseTileResources(); 213 PictureLayerImpl::ReleaseTileResources();
210 ++release_tile_resources_count_; 214 ++release_tile_resources_count_;
211 } 215 }
212 216
213 } // namespace cc 217 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698