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

Side by Side Diff: cc/picture_layer_impl.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECK Created 8 years, 1 month 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/picture_layer_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "cc/layer_tree_host_impl.h" 7 #include "cc/layer_tree_host_impl.h"
8 #include "cc/math_util.h" 8 #include "cc/math_util.h"
9 #include "cc/quad_sink.h" 9 #include "cc/quad_sink.h"
10 #include "cc/tile_draw_quad.h" 10 #include "cc/tile_draw_quad.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 rect.size(), 92 rect.size(),
93 GL_RGBA, 93 GL_RGBA,
94 rect)); 94 rect));
95 } 95 }
96 96
97 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { 97 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
98 tilings_.clear(); 98 tilings_.clear();
99 for (size_t i = 0; i < other->tilings_.size(); ++i) { 99 for (size_t i = 0; i < other->tilings_.size(); ++i) {
100 scoped_ptr<PictureLayerTiling> clone = other->tilings_[i]->Clone(); 100 scoped_ptr<PictureLayerTiling> clone = other->tilings_[i]->Clone();
101 clone->set_client(this); 101 clone->set_client(this);
102 tilings_.append(clone.Pass()); 102 tilings_.push_back(clone.Pass());
103 } 103 }
104 } 104 }
105 105
106 void PictureLayerImpl::Update() { 106 void PictureLayerImpl::Update() {
107 // TODO(enne): Add more tilings during pinch zoom. 107 // TODO(enne): Add more tilings during pinch zoom.
108 if (!tilings_.size()) { 108 if (!tilings_.size()) {
109 gfx::Size tile_size = layerTreeHostImpl()->settings().defaultTileSize; 109 gfx::Size tile_size = layerTreeHostImpl()->settings().defaultTileSize;
110 110
111 scoped_ptr<PictureLayerTiling> tiling = PictureLayerTiling::Create( 111 scoped_ptr<PictureLayerTiling> tiling = PictureLayerTiling::Create(
112 tile_size); 112 tile_size);
113 tiling->set_client(this); 113 tiling->set_client(this);
114 tiling->SetBounds(contentBounds()); 114 tiling->SetBounds(contentBounds());
115 tiling->create_tiles(gfx::Rect(gfx::Point(), contentBounds())); 115 tiling->create_tiles(gfx::Rect(gfx::Point(), contentBounds()));
116 tilings_.append(tiling.Pass()); 116 tilings_.push_back(tiling.Pass());
117 117
118 // TODO(enne): handle invalidations, create new tiles 118 // TODO(enne): handle invalidations, create new tiles
119 } 119 }
120 } 120 }
121 121
122 } // namespace cc 122 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl_unittest.cc ('k') | cc/quad_culler.cc » ('j') | cc/scoped_ptr_deque.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698