diff options
139 files changed, 316 insertions, 304 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc index 8abfa90f0..72b1e7f 100644 --- a/cc/base/math_util.cc +++ b/cc/base/math_util.cc @@ -508,7 +508,7 @@ gfx::Vector2dF MathUtil::ProjectVector(const gfx::Vector2dF& source, projected_length * destination.y()); } -scoped_ptr<base::Value> MathUtil::AsValue(gfx::Size s) { +scoped_ptr<base::Value> MathUtil::AsValue(const gfx::Size& s) { scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); res->SetDouble("width", s.width()); res->SetDouble("height", s.height()); diff --git a/cc/base/math_util.h b/cc/base/math_util.h index 6cad1ad..fca08ef 100644 --- a/cc/base/math_util.h +++ b/cc/base/math_util.h @@ -165,7 +165,7 @@ class CC_EXPORT MathUtil { const gfx::Vector2dF& destination); // Conversion to value. - static scoped_ptr<base::Value> AsValue(gfx::Size s); + static scoped_ptr<base::Value> AsValue(const gfx::Size& s); static scoped_ptr<base::Value> AsValue(const gfx::SizeF& s); static scoped_ptr<base::Value> AsValue(const gfx::Rect& r); static bool FromValue(const base::Value*, gfx::Rect* out_rect); diff --git a/cc/base/tiling_data.cc b/cc/base/tiling_data.cc index 9cdf027..8b3ba62 100644 --- a/cc/base/tiling_data.cc +++ b/cc/base/tiling_data.cc @@ -29,8 +29,8 @@ TilingData::TilingData() } TilingData::TilingData( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels) : max_texture_size_(max_texture_size), total_size_(total_size), @@ -39,8 +39,8 @@ TilingData::TilingData( } TilingData::TilingData( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, int border_texels) : max_texture_size_(max_texture_size), total_size_(total_size), @@ -48,12 +48,12 @@ TilingData::TilingData( RecomputeNumTiles(); } -void TilingData::SetTotalSize(gfx::Size total_size) { +void TilingData::SetTotalSize(const gfx::Size& total_size) { total_size_ = total_size; RecomputeNumTiles(); } -void TilingData::SetMaxTextureSize(gfx::Size max_texture_size) { +void TilingData::SetMaxTextureSize(const gfx::Size& max_texture_size) { max_texture_size_ = max_texture_size; RecomputeNumTiles(); } diff --git a/cc/base/tiling_data.h b/cc/base/tiling_data.h index 96e6ae0..9540c38 100644 --- a/cc/base/tiling_data.h +++ b/cc/base/tiling_data.h @@ -23,19 +23,19 @@ class CC_EXPORT TilingData { public: TilingData(); TilingData( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels); TilingData( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, int border_texels); gfx::Size total_size() const { return total_size_; } - void SetTotalSize(const gfx::Size total_size); + void SetTotalSize(const gfx::Size& total_size); gfx::Size max_texture_size() const { return max_texture_size_; } - void SetMaxTextureSize(gfx::Size max_texture_size); + void SetMaxTextureSize(const gfx::Size& max_texture_size); int border_texels() const { return border_texels_; } void SetHasBorderTexels(bool has_border_texels); diff --git a/cc/base/tiling_data_unittest.cc b/cc/base/tiling_data_unittest.cc index db2d6f2..55b3b6d 100644 --- a/cc/base/tiling_data_unittest.cc +++ b/cc/base/tiling_data_unittest.cc @@ -13,8 +13,8 @@ namespace cc { namespace { int NumTiles( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels) { TilingData tiling(max_texture_size, total_size, has_border_texels); int num_tiles = tiling.num_tiles_x() * tiling.num_tiles_y(); @@ -28,8 +28,8 @@ int NumTiles( } int XIndex( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int x_coord) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -37,8 +37,8 @@ int XIndex( } int YIndex( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int y_coord) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -46,8 +46,8 @@ int YIndex( } int MinBorderXIndex( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int x_coord) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -55,8 +55,8 @@ int MinBorderXIndex( } int MinBorderYIndex( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int y_coord) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -64,8 +64,8 @@ int MinBorderYIndex( } int MaxBorderXIndex( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int x_coord) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -73,8 +73,8 @@ int MaxBorderXIndex( } int MaxBorderYIndex( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int y_coord) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -82,8 +82,8 @@ int MaxBorderYIndex( } int PosX( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int x_index) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -91,8 +91,8 @@ int PosX( } int PosY( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int y_index) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -100,8 +100,8 @@ int PosY( } int SizeX( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int x_index) { TilingData tiling(max_texture_size, total_size, has_border_texels); @@ -109,8 +109,8 @@ int SizeX( } int SizeY( - gfx::Size max_texture_size, - gfx::Size total_size, + const gfx::Size& max_texture_size, + const gfx::Size& total_size, bool has_border_texels, int y_index) { TilingData tiling(max_texture_size, total_size, has_border_texels); diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc index 6616b9b..aaee787 100644 --- a/cc/layers/delegated_renderer_layer.cc +++ b/cc/layers/delegated_renderer_layer.cc @@ -86,7 +86,7 @@ void DelegatedRendererLayer::ProviderHasNewFrame() { SetNextCommitWaitsForActivation(); } -void DelegatedRendererLayer::SetDisplaySize(gfx::Size size) { +void DelegatedRendererLayer::SetDisplaySize(const gfx::Size& size) { if (display_size_ == size) return; display_size_ = size; diff --git a/cc/layers/delegated_renderer_layer.h b/cc/layers/delegated_renderer_layer.h index dc9dfee..a0b67df 100644 --- a/cc/layers/delegated_renderer_layer.h +++ b/cc/layers/delegated_renderer_layer.h @@ -33,7 +33,7 @@ class CC_EXPORT DelegatedRendererLayer : public Layer { // layer's origin. This must always contain at least the layer's bounds. A // value of (0, 0) implies that the frame should be displayed to fit exactly // in the layer's bounds. - void SetDisplaySize(gfx::Size size); + void SetDisplaySize(const gfx::Size& size); // Called by the DelegatedFrameProvider when a new frame is available to be // picked up. diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc index e4de653..418e02b 100644 --- a/cc/layers/delegated_renderer_layer_impl.cc +++ b/cc/layers/delegated_renderer_layer_impl.cc @@ -155,7 +155,7 @@ void DelegatedRendererLayerImpl::SetFrameData( have_render_passes_to_push_ = true; } -void DelegatedRendererLayerImpl::SetDisplaySize(gfx::Size size) { +void DelegatedRendererLayerImpl::SetDisplaySize(const gfx::Size& size) { if (display_size_ == size) return; display_size_ = size; @@ -197,7 +197,7 @@ void DelegatedRendererLayerImpl::ReleaseResources() { } gfx::Transform DelegatedRendererLayerImpl::DelegatedFrameToLayerSpaceTransform( - gfx::Size frame_size) const { + const gfx::Size& frame_size) const { gfx::Size display_size = display_size_.IsEmpty() ? bounds() : display_size_; gfx::Transform delegated_frame_to_layer_space_transform; @@ -394,7 +394,7 @@ void DelegatedRendererLayerImpl::AppendRenderPassQuads( QuadSink* quad_sink, AppendQuadsData* append_quads_data, const RenderPass* delegated_render_pass, - gfx::Size frame_size) const { + const gfx::Size& frame_size) const { const SharedQuadState* delegated_shared_quad_state = NULL; SharedQuadState* output_shared_quad_state = NULL; diff --git a/cc/layers/delegated_renderer_layer_impl.h b/cc/layers/delegated_renderer_layer_impl.h index a82a1f7..e71fce8 100644 --- a/cc/layers/delegated_renderer_layer_impl.h +++ b/cc/layers/delegated_renderer_layer_impl.h @@ -48,7 +48,7 @@ class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { void SetFrameData(const DelegatedFrameData* frame_data, const gfx::RectF& damage_in_frame); - void SetDisplaySize(gfx::Size size); + void SetDisplaySize(const gfx::Size& size); protected: DelegatedRendererLayerImpl(LayerTreeImpl* tree_impl, int id); @@ -77,14 +77,14 @@ class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { RenderPass::Id delegated_render_pass_id, RenderPass::Id* output_render_pass_id) const; - gfx::Transform DelegatedFrameToLayerSpaceTransform(gfx::Size frame_size) - const; + gfx::Transform DelegatedFrameToLayerSpaceTransform( + const gfx::Size& frame_size) const; void AppendRenderPassQuads( QuadSink* quad_sink, AppendQuadsData* append_quads_data, const RenderPass* delegated_render_pass, - gfx::Size frame_size) const; + const gfx::Size& frame_size) const; // LayerImpl overrides. virtual const char* LayerTypeAsString() const OVERRIDE; diff --git a/cc/layers/heads_up_display_layer.cc b/cc/layers/heads_up_display_layer.cc index 92486cc..ca63471 100644 --- a/cc/layers/heads_up_display_layer.cc +++ b/cc/layers/heads_up_display_layer.cc @@ -21,7 +21,7 @@ HeadsUpDisplayLayer::HeadsUpDisplayLayer() {} HeadsUpDisplayLayer::~HeadsUpDisplayLayer() {} void HeadsUpDisplayLayer::PrepareForCalculateDrawProperties( - gfx::Size device_viewport, float device_scale_factor) { + const gfx::Size& device_viewport, float device_scale_factor) { gfx::Size device_viewport_in_layout_pixels = gfx::Size( device_viewport.width() / device_scale_factor, device_viewport.height() / device_scale_factor); diff --git a/cc/layers/heads_up_display_layer.h b/cc/layers/heads_up_display_layer.h index 9116429..4750faf 100644 --- a/cc/layers/heads_up_display_layer.h +++ b/cc/layers/heads_up_display_layer.h @@ -18,7 +18,7 @@ class CC_EXPORT HeadsUpDisplayLayer : public ContentsScalingLayer { static scoped_refptr<HeadsUpDisplayLayer> Create(); void PrepareForCalculateDrawProperties( - gfx::Size device_viewport, float device_scale_factor); + const gfx::Size& device_viewport, float device_scale_factor); virtual bool DrawsContent() const OVERRIDE; diff --git a/cc/layers/io_surface_layer.cc b/cc/layers/io_surface_layer.cc index 1e94515..209827d 100644 --- a/cc/layers/io_surface_layer.cc +++ b/cc/layers/io_surface_layer.cc @@ -17,7 +17,7 @@ IOSurfaceLayer::IOSurfaceLayer() : Layer(), io_surface_id_(0) {} IOSurfaceLayer::~IOSurfaceLayer() {} void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id, - gfx::Size size) { + const gfx::Size& size) { io_surface_id_ = io_surface_id; io_surface_size_ = size; SetNeedsCommit(); diff --git a/cc/layers/io_surface_layer.h b/cc/layers/io_surface_layer.h index e2e831a..9939f56 100644 --- a/cc/layers/io_surface_layer.h +++ b/cc/layers/io_surface_layer.h @@ -14,7 +14,7 @@ class CC_EXPORT IOSurfaceLayer : public Layer { public: static scoped_refptr<IOSurfaceLayer> Create(); - void SetIOSurfaceProperties(uint32_t io_surface_id, gfx::Size size); + void SetIOSurfaceProperties(uint32_t io_surface_id, const gfx::Size& size); virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) OVERRIDE; diff --git a/cc/layers/io_surface_layer_impl.cc b/cc/layers/io_surface_layer_impl.cc index d2c5438..b8d6919 100644 --- a/cc/layers/io_surface_layer_impl.cc +++ b/cc/layers/io_surface_layer_impl.cc @@ -131,7 +131,7 @@ void IOSurfaceLayerImpl::ReleaseResources() { } void IOSurfaceLayerImpl::SetIOSurfaceProperties(unsigned io_surface_id, - gfx::Size size) { + const gfx::Size& size) { if (io_surface_id_ != io_surface_id) io_surface_changed_ = true; diff --git a/cc/layers/io_surface_layer_impl.h b/cc/layers/io_surface_layer_impl.h index 5c096bb..efd7428 100644 --- a/cc/layers/io_surface_layer_impl.h +++ b/cc/layers/io_surface_layer_impl.h @@ -21,7 +21,7 @@ class CC_EXPORT IOSurfaceLayerImpl : public LayerImpl { } virtual ~IOSurfaceLayerImpl(); - void SetIOSurfaceProperties(unsigned io_surface_id, gfx::Size size); + void SetIOSurfaceProperties(unsigned io_surface_id, const gfx::Size& size); virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) OVERRIDE; diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index f585006..79f00f1 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -324,7 +324,7 @@ int Layer::IndexOfChild(const Layer* reference) { return -1; } -void Layer::SetBounds(gfx::Size size) { +void Layer::SetBounds(const gfx::Size& size) { DCHECK(IsPropertyChangeAllowed()); if (bounds() == size) return; diff --git a/cc/layers/layer.h b/cc/layers/layer.h index df358f2..6b7eafc 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -116,7 +116,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, // A layer's bounds are in logical, non-page-scaled pixels (however, the // root layer's bounds are in physical pixels). - void SetBounds(gfx::Size bounds); + void SetBounds(const gfx::Size& bounds); gfx::Size bounds() const { return bounds_; } void SetMasksToBounds(bool masks_to_bounds); diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index beb282d..42338e0 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -751,7 +751,7 @@ bool LayerImpl::IsActive() const { return layer_tree_impl_->IsActiveTree(); } -void LayerImpl::SetBounds(gfx::Size bounds) { +void LayerImpl::SetBounds(const gfx::Size& bounds) { if (bounds_ == bounds) return; @@ -996,7 +996,7 @@ void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { SetNeedsPushProperties(); } -void LayerImpl::SetContentBounds(gfx::Size content_bounds) { +void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { if (this->content_bounds() == content_bounds) return; diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 66fa84b..e1dfb7e 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -340,10 +340,10 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, // contents scale to appropriate values. LayerImpl doesn't calculate any of // them from the other values. - void SetBounds(gfx::Size bounds); + void SetBounds(const gfx::Size& bounds); gfx::Size bounds() const { return bounds_; } - void SetContentBounds(gfx::Size content_bounds); + void SetContentBounds(const gfx::Size& content_bounds); gfx::Size content_bounds() const { return draw_properties_.content_bounds; } float contents_scale_x() const { return draw_properties_.contents_scale_x; } diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc index 57e4c1d..efa81e2e 100644 --- a/cc/layers/layer_position_constraint_unittest.cc +++ b/cc/layers/layer_position_constraint_unittest.cc @@ -21,7 +21,7 @@ void SetLayerPropertiesForTesting(LayerImpl* layer, const gfx::Transform& sublayer_transform, const gfx::PointF& anchor, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool preserves3d) { layer->SetTransform(transform); layer->SetSublayerTransform(sublayer_transform); diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc index 22f2c94..0755cfa 100644 --- a/cc/layers/nine_patch_layer_impl_unittest.cc +++ b/cc/layers/nine_patch_layer_impl_unittest.cc @@ -30,9 +30,9 @@ gfx::Rect ToRoundedIntRect(const gfx::RectF& rect_f) { gfx::ToRoundedInt(rect_f.height())); } -void NinePatchLayerLayoutTest(gfx::Size bitmap_size, +void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, const gfx::Rect& aperture_rect, - gfx::Size layer_size, + const gfx::Size& layer_size, const gfx::Rect& border, bool fill_center, size_t expected_quad_size) { diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index c16b115..0826186f 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -514,7 +514,7 @@ const PictureLayerTiling* PictureLayerImpl::GetTwinTiling( } gfx::Size PictureLayerImpl::CalculateTileSize( - gfx::Size content_bounds) const { + const gfx::Size& content_bounds) const { if (is_mask_) { int max_size = layer_tree_impl()->MaxTextureSize(); return gfx::Size( diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h index 0491efb..c335426 100644 --- a/cc/layers/picture_layer_impl.h +++ b/cc/layers/picture_layer_impl.h @@ -58,7 +58,7 @@ class CC_EXPORT PictureLayerImpl const gfx::Rect& content_rect) OVERRIDE; virtual void UpdatePile(Tile* tile) OVERRIDE; virtual gfx::Size CalculateTileSize( - gfx::Size content_bounds) const OVERRIDE; + const gfx::Size& content_bounds) const OVERRIDE; virtual const Region* GetInvalidation() OVERRIDE; virtual const PictureLayerTiling* GetTwinTiling( const PictureLayerTiling* tiling) const OVERRIDE; diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 8c6412d..c3b569d 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -57,7 +57,7 @@ class PictureLayerImplTest : public testing::Test { host_impl_.InitializeRenderer(CreateFakeOutputSurface()); } - void SetupDefaultTrees(gfx::Size layer_bounds) { + void SetupDefaultTrees(const gfx::Size& layer_bounds) { gfx::Size tile_size(100, 100); scoped_refptr<FakePicturePileImpl> pending_pile = @@ -76,8 +76,8 @@ class PictureLayerImplTest : public testing::Test { host_impl_.active_tree()->LayerById(id_)); } - void SetupDefaultTreesWithFixedTileSize(gfx::Size layer_bounds, - gfx::Size tile_size) { + void SetupDefaultTreesWithFixedTileSize(const gfx::Size& layer_bounds, + const gfx::Size& tile_size) { SetupDefaultTrees(layer_bounds); pending_layer_->set_fixed_tile_size(tile_size); active_layer_->set_fixed_tile_size(tile_size); diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 4fab625..bb76720 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -453,7 +453,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { public: ScrollbarLayerTestMaxTextureSize() {} - void SetScrollbarBounds(gfx::Size bounds) { bounds_ = bounds; } + void SetScrollbarBounds(const gfx::Size& bounds) { bounds_ = bounds; } virtual void BeginTest() OVERRIDE { scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar); diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc index 51bf212..2507470 100644 --- a/cc/layers/tiled_layer.cc +++ b/cc/layers/tiled_layer.cc @@ -158,7 +158,9 @@ void TiledLayer::UpdateBounds() { InvalidateContentRect(new_rects.rect()); } -void TiledLayer::SetTileSize(gfx::Size size) { tiler_->SetTileSize(size); } +void TiledLayer::SetTileSize(const gfx::Size& size) { + tiler_->SetTileSize(size); +} void TiledLayer::SetBorderTexelOption( LayerTilingData::BorderTexelOption border_texel_option) { diff --git a/cc/layers/tiled_layer.h b/cc/layers/tiled_layer.h index f2f7e96..50e2b67 100644 --- a/cc/layers/tiled_layer.h +++ b/cc/layers/tiled_layer.h @@ -46,7 +46,7 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer { void UpdateBounds(); // Exposed to subclasses for testing. - void SetTileSize(gfx::Size size); + void SetTileSize(const gfx::Size& size); void SetTextureFormat(ResourceFormat texture_format) { texture_format_ = texture_format; } diff --git a/cc/layers/tiled_layer_impl_unittest.cc b/cc/layers/tiled_layer_impl_unittest.cc index 377b04d..948ab37 100644 --- a/cc/layers/tiled_layer_impl_unittest.cc +++ b/cc/layers/tiled_layer_impl_unittest.cc @@ -23,8 +23,8 @@ class TiledLayerImplTest : public testing::Test { TiledLayerImplTest() : host_impl_(&proxy_) {} scoped_ptr<TiledLayerImpl> CreateLayerNoTiles( - gfx::Size tile_size, - gfx::Size layer_size, + const gfx::Size& tile_size, + const gfx::Size& layer_size, LayerTilingData::BorderTexelOption border_texels) { scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::Create(host_impl_.active_tree(), 1); @@ -46,8 +46,8 @@ class TiledLayerImplTest : public testing::Test { // Create a default tiled layer with textures for all tiles and a default // visibility of the entire layer size. scoped_ptr<TiledLayerImpl> CreateLayer( - gfx::Size tile_size, - gfx::Size layer_size, + const gfx::Size& tile_size, + const gfx::Size& layer_size, LayerTilingData::BorderTexelOption border_texels) { scoped_ptr<TiledLayerImpl> layer = CreateLayerNoTiles(tile_size, layer_size, border_texels); @@ -69,8 +69,8 @@ class TiledLayerImplTest : public testing::Test { void GetQuads(QuadList* quads, SharedQuadStateList* shared_states, - gfx::Size tile_size, - gfx::Size layer_size, + const gfx::Size& tile_size, + const gfx::Size& layer_size, LayerTilingData::BorderTexelOption border_texel_option, const gfx::Rect& visible_content_rect) { scoped_ptr<TiledLayerImpl> layer = diff --git a/cc/layers/ui_resource_layer_impl.cc b/cc/layers/ui_resource_layer_impl.cc index 8a45eaa..ad7fd2c 100644 --- a/cc/layers/ui_resource_layer_impl.cc +++ b/cc/layers/ui_resource_layer_impl.cc @@ -49,7 +49,7 @@ void UIResourceLayerImpl::SetUIResourceId(UIResourceId uid) { NoteLayerPropertyChanged(); } -void UIResourceLayerImpl::SetImageBounds(gfx::Size image_bounds) { +void UIResourceLayerImpl::SetImageBounds(const gfx::Size& image_bounds) { // This check imposes an ordering on the call sequence. An UIResource must // exist before SetImageBounds can be called. DCHECK(ui_resource_id_); diff --git a/cc/layers/ui_resource_layer_impl.h b/cc/layers/ui_resource_layer_impl.h index b8b06d9..c61df47 100644 --- a/cc/layers/ui_resource_layer_impl.h +++ b/cc/layers/ui_resource_layer_impl.h @@ -30,7 +30,7 @@ class CC_EXPORT UIResourceLayerImpl : public LayerImpl { void SetUIResourceId(UIResourceId uid); - void SetImageBounds(gfx::Size image_bounds); + void SetImageBounds(const gfx::Size& image_bounds); // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc index 4c55f1d..596cb3b 100644 --- a/cc/layers/ui_resource_layer_impl_unittest.cc +++ b/cc/layers/ui_resource_layer_impl_unittest.cc @@ -21,8 +21,8 @@ namespace { scoped_ptr<UIResourceLayerImpl> GenerateUIResourceLayer( FakeUIResourceLayerTreeHostImpl* host_impl, - gfx::Size bitmap_size, - gfx::Size layer_size, + const gfx::Size& bitmap_size, + const gfx::Size& layer_size, bool opaque, UIResourceId uid) { gfx::Rect visible_content_rect(layer_size); diff --git a/cc/output/copy_output_request.cc b/cc/output/copy_output_request.cc index 50173d5..56dac2a 100644 --- a/cc/output/copy_output_request.cc +++ b/cc/output/copy_output_request.cc @@ -55,7 +55,7 @@ void CopyOutputRequest::SendBitmapResult(scoped_ptr<SkBitmap> bitmap) { } void CopyOutputRequest::SendTextureResult( - gfx::Size size, + const gfx::Size& size, const TextureMailbox& texture_mailbox, scoped_ptr<SingleReleaseCallback> release_callback) { DCHECK(texture_mailbox.IsTexture()); diff --git a/cc/output/copy_output_request.h b/cc/output/copy_output_request.h index 6d8870d..dcb2fe2 100644 --- a/cc/output/copy_output_request.h +++ b/cc/output/copy_output_request.h @@ -62,7 +62,7 @@ class CC_EXPORT CopyOutputRequest { void SendEmptyResult(); void SendBitmapResult(scoped_ptr<SkBitmap> bitmap); - void SendTextureResult(gfx::Size size, + void SendTextureResult(const gfx::Size& size, const TextureMailbox& texture_mailbox, scoped_ptr<SingleReleaseCallback> release_callback); diff --git a/cc/output/copy_output_result.cc b/cc/output/copy_output_result.cc index 1831fba..adbb8de 100644 --- a/cc/output/copy_output_result.cc +++ b/cc/output/copy_output_result.cc @@ -20,7 +20,7 @@ CopyOutputResult::CopyOutputResult(scoped_ptr<SkBitmap> bitmap) } CopyOutputResult::CopyOutputResult( - gfx::Size size, + const gfx::Size& size, const TextureMailbox& texture_mailbox, scoped_ptr<SingleReleaseCallback> release_callback) : size_(size), diff --git a/cc/output/copy_output_result.h b/cc/output/copy_output_result.h index c2f011d..b4806581 100644 --- a/cc/output/copy_output_result.h +++ b/cc/output/copy_output_result.h @@ -26,7 +26,7 @@ class CC_EXPORT CopyOutputResult { return make_scoped_ptr(new CopyOutputResult(bitmap.Pass())); } static scoped_ptr<CopyOutputResult> CreateTextureResult( - gfx::Size size, + const gfx::Size& size, const TextureMailbox& texture_mailbox, scoped_ptr<SingleReleaseCallback> release_callback) { return make_scoped_ptr( @@ -47,7 +47,7 @@ class CC_EXPORT CopyOutputResult { private: CopyOutputResult(); explicit CopyOutputResult(scoped_ptr<SkBitmap> bitmap); - explicit CopyOutputResult(gfx::Size size, + explicit CopyOutputResult(const gfx::Size& size, const TextureMailbox& texture_mailbox, scoped_ptr<SingleReleaseCallback> release_callback); diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc index f90789d..06e2afb 100644 --- a/cc/output/direct_renderer.cc +++ b/cc/output/direct_renderer.cc @@ -83,7 +83,7 @@ void DirectRenderer::QuadRectTransform(gfx::Transform* quad_rect_transform, void DirectRenderer::InitializeViewport(DrawingFrame* frame, const gfx::Rect& draw_rect, const gfx::Rect& viewport_rect, - gfx::Size surface_size) { + const gfx::Size& surface_size) { bool flip_y = FlippedFramebuffer(); DCHECK_GE(viewport_rect.x(), 0); diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h index 4a447aa..08b75a1 100644 --- a/cc/output/direct_renderer.h +++ b/cc/output/direct_renderer.h @@ -74,7 +74,7 @@ class CC_EXPORT DirectRenderer : public Renderer { void InitializeViewport(DrawingFrame* frame, const gfx::Rect& draw_rect, const gfx::Rect& viewport_rect, - gfx::Size surface_size); + const gfx::Size& surface_size); gfx::Rect MoveFromDrawToWindowSpace(const gfx::RectF& draw_rect) const; bool NeedDeviceClip(const DrawingFrame* frame) const; diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 028c409..f2a3b15 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -2402,7 +2402,7 @@ void GLRenderer::FinishedReadback( unsigned source_buffer, unsigned query, uint8* dest_pixels, - gfx::Size size) { + const gfx::Size& size) { DCHECK(!pending_async_read_pixels_.empty()); if (query != 0) { diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h index 5feecd4..82befc7 100644 --- a/cc/output/gl_renderer.h +++ b/cc/output/gl_renderer.h @@ -208,7 +208,7 @@ class CC_EXPORT GLRenderer : public DirectRenderer { unsigned source_buffer, unsigned query, uint8_t* dest_pixels, - gfx::Size size); + const gfx::Size& size); void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap, scoped_ptr<SkAutoLockPixels> lock, scoped_ptr<CopyOutputRequest> request, diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc index f7bb3bd..476f7a8 100644 --- a/cc/output/gl_renderer_unittest.cc +++ b/cc/output/gl_renderer_unittest.cc @@ -1059,8 +1059,8 @@ class NonReshapableOutputSurface : public FakeOutputSurface { false) { surface_size_ = gfx::Size(500, 500); } - virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE {} - void set_fixed_size(gfx::Size size) { surface_size_ = size; } + virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE {} + void set_fixed_size(const gfx::Size& size) { surface_size_ = size; } }; TEST_F(GLRendererTest, NoDiscardOnPartialUpdates) { @@ -1674,7 +1674,7 @@ class MockOutputSurface : public OutputSurface { MOCK_METHOD0(EnsureBackbuffer, void()); MOCK_METHOD0(DiscardBackbuffer, void()); - MOCK_METHOD2(Reshape, void(gfx::Size size, float scale_factor)); + MOCK_METHOD2(Reshape, void(const gfx::Size& size, float scale_factor)); MOCK_METHOD0(BindFramebuffer, void()); MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame)); }; diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc index f3952d5..9ba6dbb 100644 --- a/cc/output/output_surface.cc +++ b/cc/output/output_surface.cc @@ -355,7 +355,7 @@ void OutputSurface::DiscardBackbuffer() { software_device_->DiscardBackbuffer(); } -void OutputSurface::Reshape(gfx::Size size, float scale_factor) { +void OutputSurface::Reshape(const gfx::Size& size, float scale_factor) { if (size == surface_size_ && scale_factor == device_scale_factor_) return; diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h index aae3b8c..754707b 100644 --- a/cc/output/output_surface.h +++ b/cc/output/output_surface.h @@ -114,7 +114,7 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient { virtual void EnsureBackbuffer(); virtual void DiscardBackbuffer(); - virtual void Reshape(gfx::Size size, float scale_factor); + virtual void Reshape(const gfx::Size& size, float scale_factor); virtual gfx::Size SurfaceSize() const; virtual void BindFramebuffer(); diff --git a/cc/output/shader.cc b/cc/output/shader.cc index b752f46..1c7040e 100644 --- a/cc/output/shader.cc +++ b/cc/output/shader.cc @@ -146,7 +146,7 @@ TexCoordPrecision TexCoordPrecisionRequired(GLES2Interface* context, TexCoordPrecision TexCoordPrecisionRequired(GLES2Interface* context, int *highp_threshold_cache, int highp_threshold_min, - gfx::Size max_size) { + const gfx::Size& max_size) { return TexCoordPrecisionRequired(context, highp_threshold_cache, highp_threshold_min, max_size.width(), max_size.height()); diff --git a/cc/output/shader.h b/cc/output/shader.h index 9473ce8..8b2a5d9 100644 --- a/cc/output/shader.h +++ b/cc/output/shader.h @@ -53,7 +53,7 @@ CC_EXPORT TexCoordPrecision TexCoordPrecisionRequired( gpu::gles2::GLES2Interface* context, int *highp_threshold_cache, int highp_threshold_min, - gfx::Size max_size); + const gfx::Size& max_size); class VertexShaderPosTex { public: diff --git a/cc/output/software_output_device.cc b/cc/output/software_output_device.cc index 3e75e06..9730f7d 100644 --- a/cc/output/software_output_device.cc +++ b/cc/output/software_output_device.cc @@ -17,7 +17,7 @@ SoftwareOutputDevice::SoftwareOutputDevice() {} SoftwareOutputDevice::~SoftwareOutputDevice() {} -void SoftwareOutputDevice::Resize(gfx::Size viewport_size) { +void SoftwareOutputDevice::Resize(const gfx::Size& viewport_size) { if (viewport_size_ == viewport_size) return; diff --git a/cc/output/software_output_device.h b/cc/output/software_output_device.h index e203902..827210e 100644 --- a/cc/output/software_output_device.h +++ b/cc/output/software_output_device.h @@ -36,7 +36,7 @@ class CC_EXPORT SoftwareOutputDevice { // Discards any pre-existing backing buffers and allocates memory for a // software device of |size|. This must be called before the // |SoftwareOutputDevice| can be used in other ways. - virtual void Resize(gfx::Size size); + virtual void Resize(const gfx::Size& size); // Called on BeginDrawingFrame. The compositor will draw into the returned // SkCanvas. The |SoftwareOutputDevice| implementation needs to provide a diff --git a/cc/quads/content_draw_quad_base.cc b/cc/quads/content_draw_quad_base.cc index ca81cf4..a802b19 100644 --- a/cc/quads/content_draw_quad_base.cc +++ b/cc/quads/content_draw_quad_base.cc @@ -22,7 +22,7 @@ void ContentDrawQuadBase::SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, const gfx::Rect& opaque_rect, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents) { gfx::Rect visible_rect = rect; bool needs_blending = false; @@ -40,7 +40,7 @@ void ContentDrawQuadBase::SetAll(const SharedQuadState* shared_quad_state, const gfx::Rect& visible_rect, bool needs_blending, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents) { DrawQuad::SetAll(shared_quad_state, material, rect, opaque_rect, visible_rect, needs_blending); diff --git a/cc/quads/content_draw_quad_base.h b/cc/quads/content_draw_quad_base.h index d07bd36..44f8bd0 100644 --- a/cc/quads/content_draw_quad_base.h +++ b/cc/quads/content_draw_quad_base.h @@ -21,7 +21,7 @@ class CC_EXPORT ContentDrawQuadBase : public DrawQuad { const gfx::Rect& rect, const gfx::Rect& opaque_rect, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents); void SetAll(const SharedQuadState* shared_quad_state, @@ -31,7 +31,7 @@ class CC_EXPORT ContentDrawQuadBase : public DrawQuad { const gfx::Rect& visible_rect, bool needs_blending, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents); gfx::RectF tex_coord_rect; diff --git a/cc/quads/io_surface_draw_quad.cc b/cc/quads/io_surface_draw_quad.cc index a415d06..d19b2ad 100644 --- a/cc/quads/io_surface_draw_quad.cc +++ b/cc/quads/io_surface_draw_quad.cc @@ -22,7 +22,7 @@ scoped_ptr<IOSurfaceDrawQuad> IOSurfaceDrawQuad::Create() { void IOSurfaceDrawQuad::SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, const gfx::Rect& opaque_rect, - gfx::Size io_surface_size, + const gfx::Size& io_surface_size, unsigned io_surface_resource_id, Orientation orientation) { gfx::Rect visible_rect = rect; @@ -39,7 +39,7 @@ void IOSurfaceDrawQuad::SetAll(const SharedQuadState* shared_quad_state, const gfx::Rect& opaque_rect, const gfx::Rect& visible_rect, bool needs_blending, - gfx::Size io_surface_size, + const gfx::Size& io_surface_size, unsigned io_surface_resource_id, Orientation orientation) { DrawQuad::SetAll(shared_quad_state, DrawQuad::IO_SURFACE_CONTENT, rect, diff --git a/cc/quads/io_surface_draw_quad.h b/cc/quads/io_surface_draw_quad.h index 9a9fa09..39975c8 100644 --- a/cc/quads/io_surface_draw_quad.h +++ b/cc/quads/io_surface_draw_quad.h @@ -25,7 +25,7 @@ class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { void SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, const gfx::Rect& opaque_rect, - gfx::Size io_surface_size, + const gfx::Size& io_surface_size, unsigned io_surface_resource_id, Orientation orientation); @@ -34,7 +34,7 @@ class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { const gfx::Rect& opaque_rect, const gfx::Rect& visible_rect, bool needs_blending, - gfx::Size io_surface_size, + const gfx::Size& io_surface_size, unsigned io_surface_resource_id, Orientation orientation); diff --git a/cc/quads/picture_draw_quad.cc b/cc/quads/picture_draw_quad.cc index f51b65b..a092c8d 100644 --- a/cc/quads/picture_draw_quad.cc +++ b/cc/quads/picture_draw_quad.cc @@ -24,7 +24,7 @@ void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, const gfx::Rect& opaque_rect, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, ResourceFormat texture_format, const gfx::Rect& content_rect, float contents_scale, @@ -49,7 +49,7 @@ void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, const gfx::Rect& visible_rect, bool needs_blending, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, ResourceFormat texture_format, const gfx::Rect& content_rect, float contents_scale, diff --git a/cc/quads/picture_draw_quad.h b/cc/quads/picture_draw_quad.h index 8f72353..76d64b0b 100644 --- a/cc/quads/picture_draw_quad.h +++ b/cc/quads/picture_draw_quad.h @@ -26,7 +26,7 @@ class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { const gfx::Rect& rect, const gfx::Rect& opaque_rect, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, ResourceFormat texture_format, const gfx::Rect& content_rect, float contents_scale, @@ -38,7 +38,7 @@ class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { const gfx::Rect& visible_rect, bool needs_blending, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, ResourceFormat texture_format, const gfx::Rect& content_rect, float contents_scale, diff --git a/cc/quads/shared_quad_state.cc b/cc/quads/shared_quad_state.cc index 66d0607..9ea3faa 100644 --- a/cc/quads/shared_quad_state.cc +++ b/cc/quads/shared_quad_state.cc @@ -28,7 +28,7 @@ scoped_ptr<SharedQuadState> SharedQuadState::Copy() const { } void SharedQuadState::SetAll(const gfx::Transform& content_to_target_transform, - gfx::Size content_bounds, + const gfx::Size& content_bounds, const gfx::Rect& visible_content_rect, const gfx::Rect& clip_rect, bool is_clipped, diff --git a/cc/quads/shared_quad_state.h b/cc/quads/shared_quad_state.h index 9c10f6c..42d977e 100644 --- a/cc/quads/shared_quad_state.h +++ b/cc/quads/shared_quad_state.h @@ -30,7 +30,7 @@ class CC_EXPORT SharedQuadState { scoped_ptr<SharedQuadState> Copy() const; void SetAll(const gfx::Transform& content_to_target_transform, - gfx::Size content_bounds, + const gfx::Size& content_bounds, const gfx::Rect& visible_content_rect, const gfx::Rect& clip_rect, bool is_clipped, diff --git a/cc/quads/tile_draw_quad.cc b/cc/quads/tile_draw_quad.cc index 60116cc..c17bb99 100644 --- a/cc/quads/tile_draw_quad.cc +++ b/cc/quads/tile_draw_quad.cc @@ -26,7 +26,7 @@ void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& opaque_rect, unsigned resource_id, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents) { ContentDrawQuadBase::SetNew(shared_quad_state, DrawQuad::TILED_CONTENT, rect, opaque_rect, tex_coord_rect, texture_size, @@ -41,7 +41,7 @@ void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state, bool needs_blending, unsigned resource_id, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents) { ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect, opaque_rect, visible_rect, needs_blending, diff --git a/cc/quads/tile_draw_quad.h b/cc/quads/tile_draw_quad.h index f4053c5..75eb4d4 100644 --- a/cc/quads/tile_draw_quad.h +++ b/cc/quads/tile_draw_quad.h @@ -19,7 +19,7 @@ class CC_EXPORT TileDrawQuad : public ContentDrawQuadBase { const gfx::Rect& opaque_rect, unsigned resource_id, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents); void SetAll(const SharedQuadState* shared_quad_state, @@ -29,7 +29,7 @@ class CC_EXPORT TileDrawQuad : public ContentDrawQuadBase { bool needs_blending, unsigned resource_id, const gfx::RectF& tex_coord_rect, - gfx::Size texture_size, + const gfx::Size& texture_size, bool swizzle_contents); unsigned resource_id; diff --git a/cc/resources/bitmap_content_layer_updater.cc b/cc/resources/bitmap_content_layer_updater.cc index 312b5a5..493b42e 100644 --- a/cc/resources/bitmap_content_layer_updater.cc +++ b/cc/resources/bitmap_content_layer_updater.cc @@ -55,7 +55,7 @@ scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::CreateResource( void BitmapContentLayerUpdater::PrepareToUpdate( const gfx::Rect& content_rect, - gfx::Size tile_size, + const gfx::Size& tile_size, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) { diff --git a/cc/resources/bitmap_content_layer_updater.h b/cc/resources/bitmap_content_layer_updater.h index d4909fa..1cb49c2 100644 --- a/cc/resources/bitmap_content_layer_updater.h +++ b/cc/resources/bitmap_content_layer_updater.h @@ -48,7 +48,7 @@ class CC_EXPORT BitmapContentLayerUpdater : public ContentLayerUpdater { virtual scoped_ptr<LayerUpdater::Resource> CreateResource( PrioritizedResourceManager* manager) OVERRIDE; virtual void PrepareToUpdate(const gfx::Rect& content_rect, - gfx::Size tile_size, + const gfx::Size& tile_size, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) OVERRIDE; diff --git a/cc/resources/layer_tiling_data.cc b/cc/resources/layer_tiling_data.cc index e9caf9b..ccbb6d0 100644 --- a/cc/resources/layer_tiling_data.cc +++ b/cc/resources/layer_tiling_data.cc @@ -10,19 +10,20 @@ namespace cc { -scoped_ptr<LayerTilingData> LayerTilingData::Create(gfx::Size tile_size, +scoped_ptr<LayerTilingData> LayerTilingData::Create(const gfx::Size& tile_size, BorderTexelOption border) { return make_scoped_ptr(new LayerTilingData(tile_size, border)); } -LayerTilingData::LayerTilingData(gfx::Size tile_size, BorderTexelOption border) +LayerTilingData::LayerTilingData(const gfx::Size& tile_size, + BorderTexelOption border) : tiling_data_(tile_size, gfx::Size(), border == HAS_BORDER_TEXELS) { SetTileSize(tile_size); } LayerTilingData::~LayerTilingData() {} -void LayerTilingData::SetTileSize(gfx::Size size) { +void LayerTilingData::SetTileSize(const gfx::Size& size) { if (tile_size() == size) return; @@ -111,7 +112,7 @@ Region LayerTilingData::OpaqueRegionInContentRect( return opaque_region; } -void LayerTilingData::SetBounds(gfx::Size size) { +void LayerTilingData::SetBounds(const gfx::Size& size) { tiling_data_.SetTotalSize(size); if (size.IsEmpty()) { tiles_.clear(); diff --git a/cc/resources/layer_tiling_data.h b/cc/resources/layer_tiling_data.h index 500c753..94644d0 100644 --- a/cc/resources/layer_tiling_data.h +++ b/cc/resources/layer_tiling_data.h @@ -27,7 +27,7 @@ class CC_EXPORT LayerTilingData { ~LayerTilingData(); - static scoped_ptr<LayerTilingData> Create(gfx::Size tile_size, + static scoped_ptr<LayerTilingData> Create(const gfx::Size& tile_size, BorderTexelOption option); bool has_empty_bounds() const { return tiling_data_.has_empty_bounds(); } @@ -41,7 +41,7 @@ class CC_EXPORT LayerTilingData { } // Change the tile size. This may invalidate all the existing tiles. - void SetTileSize(gfx::Size size); + void SetTileSize(const gfx::Size& size); gfx::Size tile_size() const; // Change the border texel setting. This may invalidate all existing tiles. void SetBorderTexelOption(BorderTexelOption option); @@ -81,7 +81,7 @@ class CC_EXPORT LayerTilingData { Tile* TileAt(int i, int j) const; const TileMap& tiles() const { return tiles_; } - void SetBounds(gfx::Size size); + void SetBounds(const gfx::Size& size); gfx::Size bounds() const { return tiling_data_.total_size(); } void ContentRectToTileIndices(const gfx::Rect& rect, @@ -96,7 +96,7 @@ class CC_EXPORT LayerTilingData { void reset() { tiles_.clear(); } protected: - LayerTilingData(gfx::Size tile_size, BorderTexelOption option); + LayerTilingData(const gfx::Size& tile_size, BorderTexelOption option); TileMap tiles_; TilingData tiling_data_; diff --git a/cc/resources/layer_updater.h b/cc/resources/layer_updater.h index 730773f..d12d7b4 100644 --- a/cc/resources/layer_updater.h +++ b/cc/resources/layer_updater.h @@ -49,7 +49,7 @@ class CC_EXPORT LayerUpdater : public base::RefCounted<LayerUpdater> { // painted opaque. If the layer is marked opaque in the updater, then this // region should be ignored in preference for the entire layer's area. virtual void PrepareToUpdate(const gfx::Rect& content_rect, - gfx::Size tile_size, + const gfx::Size& tile_size, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) {} diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc index 5304127..cfab6f25 100644 --- a/cc/resources/picture_layer_tiling.cc +++ b/cc/resources/picture_layer_tiling.cc @@ -19,7 +19,7 @@ namespace cc { scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client) { return make_scoped_ptr(new PictureLayerTiling(contents_scale, layer_bounds, @@ -27,7 +27,7 @@ scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( } PictureLayerTiling::PictureLayerTiling(float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client) : contents_scale_(contents_scale), layer_bounds_(layer_bounds), @@ -125,7 +125,7 @@ void PictureLayerTiling::CreateMissingTilesInLiveTilesRect() { } } -void PictureLayerTiling::SetLayerBounds(gfx::Size layer_bounds) { +void PictureLayerTiling::SetLayerBounds(const gfx::Size& layer_bounds) { if (layer_bounds_ == layer_bounds) return; @@ -341,11 +341,11 @@ void PictureLayerTiling::Reset() { void PictureLayerTiling::UpdateTilePriorities( WhichTree tree, - gfx::Size device_viewport, + const gfx::Size& device_viewport, const gfx::Rect& viewport_in_layer_space, const gfx::Rect& visible_layer_rect, - gfx::Size last_layer_bounds, - gfx::Size current_layer_bounds, + const gfx::Size& last_layer_bounds, + const gfx::Size& current_layer_bounds, float last_layer_contents_scale, float current_layer_contents_scale, const gfx::Transform& last_screen_transform, diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h index 0c194be..f4c5e7c 100644 --- a/cc/resources/picture_layer_tiling.h +++ b/cc/resources/picture_layer_tiling.h @@ -31,7 +31,7 @@ class CC_EXPORT PictureLayerTilingClient { const gfx::Rect& content_rect) = 0; virtual void UpdatePile(Tile* tile) = 0; virtual gfx::Size CalculateTileSize( - gfx::Size content_bounds) const = 0; + const gfx::Size& content_bounds) const = 0; virtual const Region* GetInvalidation() = 0; virtual const PictureLayerTiling* GetTwinTiling( const PictureLayerTiling* tiling) const = 0; @@ -47,10 +47,10 @@ class CC_EXPORT PictureLayerTiling { // Create a tiling with no tiles. CreateTiles must be called to add some. static scoped_ptr<PictureLayerTiling> Create( float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client); gfx::Size layer_bounds() const { return layer_bounds_; } - void SetLayerBounds(gfx::Size layer_bounds); + void SetLayerBounds(const gfx::Size& layer_bounds); void Invalidate(const Region& layer_region); void CreateMissingTilesInLiveTilesRect(); @@ -135,11 +135,11 @@ class CC_EXPORT PictureLayerTiling { void UpdateTilePriorities( WhichTree tree, - gfx::Size device_viewport, + const gfx::Size& device_viewport, const gfx::Rect& viewport_in_layer_space, const gfx::Rect& visible_layer_rect, - gfx::Size last_layer_bounds, - gfx::Size current_layer_bounds, + const gfx::Size& last_layer_bounds, + const gfx::Size& current_layer_bounds, float last_layer_contents_scale, float current_layer_contents_scale, const gfx::Transform& last_screen_transform, @@ -193,7 +193,7 @@ class CC_EXPORT PictureLayerTiling { typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; PictureLayerTiling(float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client); void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); void CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc index 2047c3a..c8ac648 100644 --- a/cc/resources/picture_layer_tiling_set.cc +++ b/cc/resources/picture_layer_tiling_set.cc @@ -22,7 +22,7 @@ class LargestToSmallestScaleFunctor { PictureLayerTilingSet::PictureLayerTilingSet( PictureLayerTilingClient* client, - gfx::Size layer_bounds) + const gfx::Size& layer_bounds) : client_(client), layer_bounds_(layer_bounds) { } @@ -38,7 +38,7 @@ void PictureLayerTilingSet::SetClient(PictureLayerTilingClient* client) { void PictureLayerTilingSet::SyncTilings( const PictureLayerTilingSet& other, - gfx::Size new_layer_bounds, + const gfx::Size& new_layer_bounds, const Region& layer_invalidation, float minimum_contents_scale) { if (new_layer_bounds.IsEmpty()) { @@ -303,11 +303,11 @@ PictureLayerTilingSet::CoverageIterator::operator bool() const { void PictureLayerTilingSet::UpdateTilePriorities( WhichTree tree, - gfx::Size device_viewport, + const gfx::Size& device_viewport, const gfx::Rect& viewport_in_content_space, const gfx::Rect& visible_content_rect, - gfx::Size last_layer_bounds, - gfx::Size current_layer_bounds, + const gfx::Size& last_layer_bounds, + const gfx::Size& current_layer_bounds, float last_layer_contents_scale, float current_layer_contents_scale, const gfx::Transform& last_screen_transform, diff --git a/cc/resources/picture_layer_tiling_set.h b/cc/resources/picture_layer_tiling_set.h index fe19d76..bff3bd6 100644 --- a/cc/resources/picture_layer_tiling_set.h +++ b/cc/resources/picture_layer_tiling_set.h @@ -15,7 +15,7 @@ namespace cc { class CC_EXPORT PictureLayerTilingSet { public: PictureLayerTilingSet(PictureLayerTilingClient* client, - gfx::Size layer_bounds); + const gfx::Size& layer_bounds); ~PictureLayerTilingSet(); void SetClient(PictureLayerTilingClient* client); @@ -27,7 +27,7 @@ class CC_EXPORT PictureLayerTilingSet { // tilings to |new_layer_bounds|. void SyncTilings( const PictureLayerTilingSet& other, - gfx::Size new_layer_bounds, + const gfx::Size& new_layer_bounds, const Region& layer_invalidation, float minimum_contents_scale); @@ -56,11 +56,11 @@ class CC_EXPORT PictureLayerTilingSet { void UpdateTilePriorities( WhichTree tree, - gfx::Size device_viewport, + const gfx::Size& device_viewport, const gfx::Rect& viewport_in_content_space, const gfx::Rect& visible_content_rect, - gfx::Size last_layer_bounds, - gfx::Size current_layer_bounds, + const gfx::Size& last_layer_bounds, + const gfx::Size& current_layer_bounds, float last_layer_contents_scale, float current_layer_contents_scale, const gfx::Transform& last_screen_transform, diff --git a/cc/resources/picture_layer_tiling_set_unittest.cc b/cc/resources/picture_layer_tiling_set_unittest.cc index 96129c6..3939f09 100644 --- a/cc/resources/picture_layer_tiling_set_unittest.cc +++ b/cc/resources/picture_layer_tiling_set_unittest.cc @@ -157,7 +157,7 @@ class PictureLayerTilingSetSyncTest : public testing::Test { } // Sync from source to target. - void SyncTilings(gfx::Size new_bounds, + void SyncTilings(const gfx::Size& new_bounds, const Region& invalidation, float minimum_scale) { for (size_t i = 0; i < source_->num_tilings(); ++i) @@ -168,19 +168,19 @@ class PictureLayerTilingSetSyncTest : public testing::Test { target_->SyncTilings( *source_.get(), new_bounds, invalidation, minimum_scale); } - void SyncTilings(gfx::Size new_bounds) { + void SyncTilings(const gfx::Size& new_bounds) { Region invalidation; SyncTilings(new_bounds, invalidation, 0.f); } - void SyncTilings(gfx::Size new_bounds, const Region& invalidation) { + void SyncTilings(const gfx::Size& new_bounds, const Region& invalidation) { SyncTilings(new_bounds, invalidation, 0.f); } - void SyncTilings(gfx::Size new_bounds, float minimum_scale) { + void SyncTilings(const gfx::Size& new_bounds, float minimum_scale) { Region invalidation; SyncTilings(new_bounds, invalidation, minimum_scale); } - void VerifyTargetEqualsSource(gfx::Size new_bounds) const { + void VerifyTargetEqualsSource(const gfx::Size& new_bounds) const { ASSERT_FALSE(new_bounds.IsEmpty()); EXPECT_EQ(target_->num_tilings(), source_->num_tilings()); EXPECT_EQ(target_->layer_bounds().ToString(), new_bounds.ToString()); diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc index 002e9aad..83dc4aa 100644 --- a/cc/resources/picture_layer_tiling_unittest.cc +++ b/cc/resources/picture_layer_tiling_unittest.cc @@ -18,7 +18,7 @@ namespace { static gfx::Rect ViewportInLayerSpace( const gfx::Transform& transform, - gfx::Size device_viewport) { + const gfx::Size& device_viewport) { gfx::Transform inverse; if (!transform.GetInverse(&inverse)) @@ -37,7 +37,7 @@ class TestablePictureLayerTiling : public PictureLayerTiling { static scoped_ptr<TestablePictureLayerTiling> Create( float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client) { return make_scoped_ptr(new TestablePictureLayerTiling( contents_scale, @@ -47,7 +47,7 @@ class TestablePictureLayerTiling : public PictureLayerTiling { protected: TestablePictureLayerTiling(float contents_scale, - gfx::Size layer_bounds, + const gfx::Size& layer_bounds, PictureLayerTilingClient* client) : PictureLayerTiling(contents_scale, layer_bounds, client) { } }; @@ -57,9 +57,9 @@ class PictureLayerTilingIteratorTest : public testing::Test { PictureLayerTilingIteratorTest() {} virtual ~PictureLayerTilingIteratorTest() {} - void Initialize(gfx::Size tile_size, + void Initialize(const gfx::Size& tile_size, float contents_scale, - gfx::Size layer_bounds) { + const gfx::Size& layer_bounds) { client_.SetTileSize(tile_size); tiling_ = TestablePictureLayerTiling::Create(contents_scale, layer_bounds, diff --git a/cc/resources/picture_pile_base.cc b/cc/resources/picture_pile_base.cc index 8fedced..2c87f59 100644 --- a/cc/resources/picture_pile_base.cc +++ b/cc/resources/picture_pile_base.cc @@ -87,7 +87,7 @@ PicturePileBase::PicturePileBase( PicturePileBase::~PicturePileBase() { } -void PicturePileBase::Resize(gfx::Size new_size) { +void PicturePileBase::Resize(const gfx::Size& new_size) { if (size() == new_size) return; @@ -136,7 +136,7 @@ void PicturePileBase::SetMinContentsScale(float min_contents_scale) { // static void PicturePileBase::ComputeTileGridInfo( - gfx::Size tile_grid_size, + const gfx::Size& tile_grid_size, SkTileGridPicture::TileGridInfo* info) { DCHECK(info); info->fTileInterval.set(tile_grid_size.width() - 2 * kTileGridBorderPixels, @@ -150,7 +150,7 @@ void PicturePileBase::ComputeTileGridInfo( info->fOffset.set(-kTileGridBorderPixels, -kTileGridBorderPixels); } -void PicturePileBase::SetTileGridSize(gfx::Size tile_grid_size) { +void PicturePileBase::SetTileGridSize(const gfx::Size& tile_grid_size) { ComputeTileGridInfo(tile_grid_size, &tile_grid_info_); } diff --git a/cc/resources/picture_pile_base.h b/cc/resources/picture_pile_base.h index 2ef6b61..26f6bdb 100644 --- a/cc/resources/picture_pile_base.h +++ b/cc/resources/picture_pile_base.h @@ -29,7 +29,7 @@ class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { explicit PicturePileBase(const PicturePileBase* other); PicturePileBase(const PicturePileBase* other, unsigned thread_index); - void Resize(gfx::Size size); + void Resize(const gfx::Size& size); gfx::Size size() const { return tiling_.total_size(); } void SetMinContentsScale(float min_contents_scale); @@ -42,10 +42,10 @@ class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { bool HasRecordingAt(int x, int y); bool CanRaster(float contents_scale, const gfx::Rect& content_rect); - static void ComputeTileGridInfo(gfx::Size tile_grid_size, + static void ComputeTileGridInfo(const gfx::Size& tile_grid_size, SkTileGridPicture::TileGridInfo* info); - void SetTileGridSize(gfx::Size tile_grid_size); + void SetTileGridSize(const gfx::Size& tile_grid_size); TilingData& tiling() { return tiling_; } scoped_ptr<base::Value> AsValue() const; diff --git a/cc/resources/prioritized_resource.cc b/cc/resources/prioritized_resource.cc index 25415f5..0fc705a 100644 --- a/cc/resources/prioritized_resource.cc +++ b/cc/resources/prioritized_resource.cc @@ -14,7 +14,7 @@ namespace cc { PrioritizedResource::PrioritizedResource(PrioritizedResourceManager* manager, - gfx::Size size, + const gfx::Size& size, ResourceFormat format) : size_(size), format_(format), @@ -45,7 +45,8 @@ void PrioritizedResource::SetTextureManager( manager->RegisterTexture(this); } -void PrioritizedResource::SetDimensions(gfx::Size size, ResourceFormat format) { +void PrioritizedResource::SetDimensions(const gfx::Size& size, + ResourceFormat format) { if (format_ != format || size_ != size) { is_above_priority_cutoff_ = false; format_ = format; @@ -117,7 +118,7 @@ void PrioritizedResource::SetToSelfManagedMemoryPlaceholder(size_t bytes) { PrioritizedResource::Backing::Backing(unsigned id, ResourceProvider* resource_provider, - gfx::Size size, + const gfx::Size& size, ResourceFormat format) : Resource(id, size, format), owner_(NULL), diff --git a/cc/resources/prioritized_resource.h b/cc/resources/prioritized_resource.h index 641782e..cf8df6a 100644 --- a/cc/resources/prioritized_resource.h +++ b/cc/resources/prioritized_resource.h @@ -25,7 +25,7 @@ class CC_EXPORT PrioritizedResource { public: static scoped_ptr<PrioritizedResource> Create( PrioritizedResourceManager* manager, - gfx::Size size, + const gfx::Size& size, ResourceFormat format) { return make_scoped_ptr(new PrioritizedResource(manager, size, format)); } @@ -40,7 +40,7 @@ class CC_EXPORT PrioritizedResource { // Setting these to the same value is a no-op. void SetTextureManager(PrioritizedResourceManager* manager); PrioritizedResourceManager* resource_manager() { return manager_; } - void SetDimensions(gfx::Size size, ResourceFormat format); + void SetDimensions(const gfx::Size& size, ResourceFormat format); ResourceFormat format() const { return format_; } gfx::Size size() const { return size_; } size_t bytes() const { return bytes_; } @@ -107,7 +107,7 @@ class CC_EXPORT PrioritizedResource { public: Backing(unsigned id, ResourceProvider* resource_provider, - gfx::Size size, + const gfx::Size& size, ResourceFormat format); ~Backing(); void UpdatePriority(); @@ -150,7 +150,7 @@ class CC_EXPORT PrioritizedResource { }; PrioritizedResource(PrioritizedResourceManager* resource_manager, - gfx::Size size, + const gfx::Size& size, ResourceFormat format); bool is_above_priority_cutoff() { return is_above_priority_cutoff_; } diff --git a/cc/resources/prioritized_resource_manager.cc b/cc/resources/prioritized_resource_manager.cc index da8f055..707ad77 100644 --- a/cc/resources/prioritized_resource_manager.cc +++ b/cc/resources/prioritized_resource_manager.cc @@ -445,7 +445,7 @@ void PrioritizedResourceManager::ReturnBackingTexture( } PrioritizedResource::Backing* PrioritizedResourceManager::CreateBacking( - gfx::Size size, + const gfx::Size& size, ResourceFormat format, ResourceProvider* resource_provider) { DCHECK(proxy_->IsImplThread() && proxy_->IsMainThreadBlocked()); diff --git a/cc/resources/prioritized_resource_manager.h b/cc/resources/prioritized_resource_manager.h index 9b558a4..092b1d7 100644 --- a/cc/resources/prioritized_resource_manager.h +++ b/cc/resources/prioritized_resource_manager.h @@ -40,7 +40,7 @@ class CC_EXPORT PrioritizedResourceManager { return make_scoped_ptr(new PrioritizedResourceManager(proxy)); } scoped_ptr<PrioritizedResource> CreateTexture( - gfx::Size size, ResourceFormat format) { + const gfx::Size& size, ResourceFormat format) { return make_scoped_ptr(new PrioritizedResource(this, size, format)); } ~PrioritizedResourceManager(); @@ -189,7 +189,7 @@ class CC_EXPORT PrioritizedResourceManager { UnlinkPolicy unlink_policy, ResourceProvider* resource_provider); PrioritizedResource::Backing* CreateBacking( - gfx::Size size, + const gfx::Size& size, ResourceFormat format, ResourceProvider* resource_provider); void EvictFirstBackingResource(ResourceProvider* resource_provider); diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc index 0b47981..0da81e2 100644 --- a/cc/resources/raster_worker_pool.cc +++ b/cc/resources/raster_worker_pool.cc @@ -123,7 +123,7 @@ class RasterWorkerPoolTaskImpl : public internal::RasterWorkerPoolTask { void RunRasterOnThread(unsigned thread_index, void* buffer, - gfx::Size size, + const gfx::Size& size, int stride) { TRACE_EVENT2( "cc", diff --git a/cc/resources/resource.h b/cc/resources/resource.h index e9dd393a..24cb88a 100644 --- a/cc/resources/resource.h +++ b/cc/resources/resource.h @@ -15,7 +15,7 @@ namespace cc { class CC_EXPORT Resource { public: Resource() : id_(0) {} - Resource(unsigned id, gfx::Size size, ResourceFormat format) + Resource(unsigned id, const gfx::Size& size, ResourceFormat format) : id_(id), size_(size), format_(format) {} @@ -25,14 +25,15 @@ class CC_EXPORT Resource { ResourceFormat format() const { return format_; } size_t bytes() const; - inline static size_t MemorySizeBytes(gfx::Size size, ResourceFormat format) { + inline static size_t MemorySizeBytes(const gfx::Size& size, + ResourceFormat format) { DCHECK_EQ(0u, (BitsPerPixel(format) * size.width() * size.height()) % 8); return (BitsPerPixel(format) * size.width() * size.height()) / 8; } protected: void set_id(ResourceProvider::ResourceId id) { id_ = id; } - void set_dimensions(gfx::Size size, ResourceFormat format) { + void set_dimensions(const gfx::Size& size, ResourceFormat format) { size_ = size; format_ = format; } diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc index bf5ff3f..7170a39 100644 --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc @@ -35,7 +35,8 @@ ResourcePool::~ResourcePool() { DCHECK_EQ(0u, resource_count_); } -scoped_ptr<ScopedResource> ResourcePool::AcquireResource(gfx::Size size) { +scoped_ptr<ScopedResource> ResourcePool::AcquireResource( + const gfx::Size& size) { for (ResourceList::iterator it = unused_resources_.begin(); it != unused_resources_.end(); ++it) { diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h index d05534d..e321d08 100644 --- a/cc/resources/resource_pool.h +++ b/cc/resources/resource_pool.h @@ -26,7 +26,7 @@ class CC_EXPORT ResourcePool { virtual ~ResourcePool(); - scoped_ptr<ScopedResource> AcquireResource(gfx::Size size); + scoped_ptr<ScopedResource> AcquireResource(const gfx::Size& size); void ReleaseResource(scoped_ptr<ScopedResource>); void SetResourceUsageLimits(size_t max_memory_usage_bytes, diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index b431648..8b9453f 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc @@ -197,7 +197,7 @@ ResourceProvider::Resource::Resource() ResourceProvider::Resource::~Resource() {} ResourceProvider::Resource::Resource(GLuint texture_id, - gfx::Size size, + const gfx::Size& size, GLenum target, GLenum filter, GLenum texture_pool, @@ -240,7 +240,7 @@ ResourceProvider::Resource::Resource(GLuint texture_id, ResourceProvider::Resource::Resource(uint8_t* pixels, SharedBitmap* bitmap, - gfx::Size size, + const gfx::Size& size, GLenum filter, GLint wrap_mode) : child_id(0), @@ -330,7 +330,7 @@ bool ResourceProvider::IsLost(ResourceId id) { } ResourceProvider::ResourceId ResourceProvider::CreateResource( - gfx::Size size, + const gfx::Size& size, GLint wrap_mode, TextureUsageHint hint, ResourceFormat format) { @@ -355,7 +355,7 @@ ResourceProvider::ResourceId ResourceProvider::CreateResource( } ResourceProvider::ResourceId ResourceProvider::CreateManagedResource( - gfx::Size size, + const gfx::Size& size, GLenum target, GLint wrap_mode, TextureUsageHint hint, @@ -381,7 +381,7 @@ ResourceProvider::ResourceId ResourceProvider::CreateManagedResource( } ResourceProvider::ResourceId ResourceProvider::CreateGLTexture( - gfx::Size size, + const gfx::Size& size, GLenum target, GLenum texture_pool, GLint wrap_mode, @@ -400,7 +400,7 @@ ResourceProvider::ResourceId ResourceProvider::CreateGLTexture( } ResourceProvider::ResourceId ResourceProvider::CreateBitmap( - gfx::Size size, GLint wrap_mode) { + const gfx::Size& size, GLint wrap_mode) { DCHECK(thread_checker_.CalledOnValidThread()); scoped_ptr<SharedBitmap> bitmap; diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h index 836eae3..c53cf8f 100644 --- a/cc/resources/resource_provider.h +++ b/cc/resources/resource_provider.h @@ -97,28 +97,28 @@ class CC_EXPORT ResourceProvider { ResourceType GetResourceType(ResourceId id); // Creates a resource of the default resource type. - ResourceId CreateResource(gfx::Size size, + ResourceId CreateResource(const gfx::Size& size, GLint wrap_mode, TextureUsageHint hint, ResourceFormat format); // Creates a resource which is tagged as being managed for GPU memory // accounting purposes. - ResourceId CreateManagedResource(gfx::Size size, + ResourceId CreateManagedResource(const gfx::Size& size, GLenum target, GLint wrap_mode, TextureUsageHint hint, ResourceFormat format); // You can also explicitly create a specific resource type. - ResourceId CreateGLTexture(gfx::Size size, + ResourceId CreateGLTexture(const gfx::Size& size, GLenum target, GLenum texture_pool, GLint wrap_mode, TextureUsageHint hint, ResourceFormat format); - ResourceId CreateBitmap(gfx::Size size, GLint wrap_mode); + ResourceId CreateBitmap(const gfx::Size& size, GLint wrap_mode); // Wraps an external texture into a GL resource. ResourceId CreateResourceFromExternalTexture( unsigned texture_target, @@ -366,7 +366,7 @@ class CC_EXPORT ResourceProvider { Resource(); ~Resource(); Resource(unsigned texture_id, - gfx::Size size, + const gfx::Size& size, GLenum target, GLenum filter, GLenum texture_pool, @@ -375,7 +375,7 @@ class CC_EXPORT ResourceProvider { ResourceFormat format); Resource(uint8_t* pixels, SharedBitmap* bitmap, - gfx::Size size, + const gfx::Size& size, GLenum filter, GLint wrap_mode); diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index f96982f..bce6d5a 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc @@ -64,7 +64,7 @@ static void ReleaseSharedMemoryCallback( } static scoped_ptr<base::SharedMemory> CreateAndFillSharedMemory( - gfx::Size size, + const gfx::Size& size, uint32_t value) { scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); CHECK(shared_memory->CreateAndMapAnonymous(4 * size.GetArea())); @@ -264,7 +264,9 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { namespace_->textures.Replace(BoundTextureId(target), texture); } - void GetPixels(gfx::Size size, ResourceFormat format, uint8_t* pixels) { + void GetPixels(const gfx::Size& size, + ResourceFormat format, + uint8_t* pixels) { CheckTextureIsBound(GL_TEXTURE_2D); base::AutoLock lock_for_texture_access(namespace_->lock); scoped_refptr<TestTexture> texture = BoundTexture(GL_TEXTURE_2D); @@ -279,7 +281,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { last_waited_sync_point_(0) {} private: - void AllocateTexture(gfx::Size size, GLenum format) { + void AllocateTexture(const gfx::Size& size, GLenum format) { CheckTextureIsBound(GL_TEXTURE_2D); ResourceFormat texture_format = RGBA_8888; switch (format) { @@ -340,7 +342,7 @@ class TestSharedBitmapManager : public SharedBitmapManager { TestSharedBitmapManager() : count_(0) {} virtual ~TestSharedBitmapManager() {} - virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(gfx::Size size) + virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size) OVERRIDE { scoped_ptr<base::SharedMemory> memory(new base::SharedMemory); memory->CreateAndMapAnonymous(size.GetArea() * 4); @@ -354,7 +356,7 @@ class TestSharedBitmapManager : public SharedBitmapManager { } virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId( - gfx::Size, + const gfx::Size&, const SharedBitmapId& id) OVERRIDE { if (bitmap_map_.find(id) == bitmap_map_.end()) return scoped_ptr<SharedBitmap>(); @@ -381,7 +383,7 @@ class TestSharedBitmapManager : public SharedBitmapManager { void GetResourcePixels(ResourceProvider* resource_provider, ResourceProviderContext* context, ResourceProvider::ResourceId id, - gfx::Size size, + const gfx::Size& size, ResourceFormat format, uint8_t* pixels) { switch (resource_provider->default_resource_type()) { diff --git a/cc/resources/scoped_resource.cc b/cc/resources/scoped_resource.cc index 99f93c9..a320bab 100644 --- a/cc/resources/scoped_resource.cc +++ b/cc/resources/scoped_resource.cc @@ -15,7 +15,7 @@ ScopedResource::~ScopedResource() { Free(); } -void ScopedResource::Allocate(gfx::Size size, +void ScopedResource::Allocate(const gfx::Size& size, ResourceProvider::TextureUsageHint hint, ResourceFormat format) { DCHECK(!id()); @@ -30,7 +30,7 @@ void ScopedResource::Allocate(gfx::Size size, #endif } -void ScopedResource::AllocateManaged(gfx::Size size, +void ScopedResource::AllocateManaged(const gfx::Size& size, GLenum target, ResourceFormat format) { DCHECK(!id()); diff --git a/cc/resources/scoped_resource.h b/cc/resources/scoped_resource.h index 63f2cd4..eebddc1 100644 --- a/cc/resources/scoped_resource.h +++ b/cc/resources/scoped_resource.h @@ -25,10 +25,12 @@ class CC_EXPORT ScopedResource : public Resource { } virtual ~ScopedResource(); - void Allocate(gfx::Size size, + void Allocate(const gfx::Size& size, ResourceProvider::TextureUsageHint hint, ResourceFormat format); - void AllocateManaged(gfx::Size size, GLenum target, ResourceFormat format); + void AllocateManaged(const gfx::Size& size, + GLenum target, + ResourceFormat format); void Free(); void Leak(); diff --git a/cc/resources/shared_bitmap_manager.h b/cc/resources/shared_bitmap_manager.h index 53dd156..70eaed5 100644 --- a/cc/resources/shared_bitmap_manager.h +++ b/cc/resources/shared_bitmap_manager.h @@ -16,9 +16,9 @@ class CC_EXPORT SharedBitmapManager { public: SharedBitmapManager() {} - virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(gfx::Size) = 0; + virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size&) = 0; virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId( - gfx::Size, + const gfx::Size&, const SharedBitmapId&) = 0; virtual scoped_ptr<SharedBitmap> GetBitmapForSharedMemory( base::SharedMemory*) = 0; diff --git a/cc/resources/skpicture_content_layer_updater.cc b/cc/resources/skpicture_content_layer_updater.cc index 5242686..a08b2b4 100644 --- a/cc/resources/skpicture_content_layer_updater.cc +++ b/cc/resources/skpicture_content_layer_updater.cc @@ -23,7 +23,7 @@ SkPictureContentLayerUpdater::~SkPictureContentLayerUpdater() {} void SkPictureContentLayerUpdater::PrepareToUpdate( const gfx::Rect& content_rect, - gfx::Size, + const gfx::Size&, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) { diff --git a/cc/resources/skpicture_content_layer_updater.h b/cc/resources/skpicture_content_layer_updater.h index 0e83d42..e5891841 100644 --- a/cc/resources/skpicture_content_layer_updater.h +++ b/cc/resources/skpicture_content_layer_updater.h @@ -25,7 +25,7 @@ class SkPictureContentLayerUpdater : public ContentLayerUpdater { virtual ~SkPictureContentLayerUpdater(); virtual void PrepareToUpdate(const gfx::Rect& content_rect, - gfx::Size tile_size, + const gfx::Size& tile_size, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) OVERRIDE; diff --git a/cc/resources/texture_mailbox.cc b/cc/resources/texture_mailbox.cc index 149d56c..074967f 100644 --- a/cc/resources/texture_mailbox.cc +++ b/cc/resources/texture_mailbox.cc @@ -50,7 +50,7 @@ TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name, } TextureMailbox::TextureMailbox(base::SharedMemory* shared_memory, - gfx::Size size) + const gfx::Size& size) : target_(GL_TEXTURE_2D), sync_point_(0), shared_memory_(shared_memory), diff --git a/cc/resources/texture_mailbox.h b/cc/resources/texture_mailbox.h index a9b021b..8ff87cc 100644 --- a/cc/resources/texture_mailbox.h +++ b/cc/resources/texture_mailbox.h @@ -28,7 +28,7 @@ class CC_EXPORT TextureMailbox { unsigned texture_target, unsigned sync_point); TextureMailbox(base::SharedMemory* shared_memory, - gfx::Size size); + const gfx::Size& size); ~TextureMailbox(); diff --git a/cc/resources/tile.cc b/cc/resources/tile.cc index 0c407e5..7b1f00a 100644 --- a/cc/resources/tile.cc +++ b/cc/resources/tile.cc @@ -15,7 +15,7 @@ Tile::Id Tile::s_next_id_ = 0; Tile::Tile(TileManager* tile_manager, PicturePileImpl* picture_pile, - gfx::Size tile_size, + const gfx::Size& tile_size, const gfx::Rect& content_rect, const gfx::Rect& opaque_rect, float contents_scale, diff --git a/cc/resources/tile.h b/cc/resources/tile.h index 621a2e2..c0ed843 100644 --- a/cc/resources/tile.h +++ b/cc/resources/tile.h @@ -135,7 +135,7 @@ class CC_EXPORT Tile : public RefCountedManaged<Tile> { // Methods called by by tile manager. Tile(TileManager* tile_manager, PicturePileImpl* picture_pile, - gfx::Size tile_size, + const gfx::Size& tile_size, const gfx::Rect& content_rect, const gfx::Rect& opaque_rect, float contents_scale, diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 4c6fc81..4f9f0ae 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -957,7 +957,7 @@ void TileManager::OnRasterTaskCompleted( } scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, - gfx::Size tile_size, + const gfx::Size& tile_size, const gfx::Rect& content_rect, const gfx::Rect& opaque_rect, float contents_scale, diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h index 38d0465..0e7de2c 100644 --- a/cc/resources/tile_manager.h +++ b/cc/resources/tile_manager.h @@ -66,7 +66,7 @@ class CC_EXPORT TileManager : public RasterWorkerPoolClient, bool UpdateVisibleTiles(); scoped_refptr<Tile> CreateTile(PicturePileImpl* picture_pile, - gfx::Size tile_size, + const gfx::Size& tile_size, const gfx::Rect& content_rect, const gfx::Rect& opaque_rect, float contents_scale, diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc index bdf466b..56f062e 100644 --- a/cc/resources/tile_manager_unittest.cc +++ b/cc/resources/tile_manager_unittest.cc @@ -76,7 +76,7 @@ class TileManagerTest : public testing::TestWithParam<bool> { TileVector CreateTilesWithSize(int count, TilePriority active_priority, TilePriority pending_priority, - gfx::Size tile_size) { + const gfx::Size& tile_size) { TileVector tiles; for (int i = 0; i < count; ++i) { scoped_refptr<Tile> tile = tile_manager_->CreateTile(picture_pile_.get(), diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc index bae7468..54e4a5c 100644 --- a/cc/resources/video_resource_updater.cc +++ b/cc/resources/video_resource_updater.cc @@ -89,7 +89,7 @@ bool VideoResourceUpdater::VerifyFrame( // each plane in the frame. static gfx::Size SoftwarePlaneDimension( media::VideoFrame::Format input_frame_format, - gfx::Size coded_size, + const gfx::Size& coded_size, ResourceFormat output_resource_format, int plane_index) { if (output_resource_format == kYUVResourceFormat) { diff --git a/cc/resources/video_resource_updater.h b/cc/resources/video_resource_updater.h index 2a27739..afc3b88 100644 --- a/cc/resources/video_resource_updater.h +++ b/cc/resources/video_resource_updater.h @@ -80,7 +80,7 @@ class CC_EXPORT VideoResourceUpdater gpu::Mailbox mailbox; PlaneResource(unsigned resource_id, - gfx::Size resource_size, + const gfx::Size& resource_size, ResourceFormat resource_format, gpu::Mailbox mailbox) : resource_id(resource_id), diff --git a/cc/scheduler/texture_uploader.cc b/cc/scheduler/texture_uploader.cc index e194ede..b15fe41 100644 --- a/cc/scheduler/texture_uploader.cc +++ b/cc/scheduler/texture_uploader.cc @@ -133,7 +133,7 @@ void TextureUploader::Upload(const uint8* image, const gfx::Rect& source_rect, gfx::Vector2d dest_offset, ResourceFormat format, - gfx::Size size) { + const gfx::Size& size) { CHECK(image_rect.Contains(source_rect)); bool is_full_upload = dest_offset.IsZero() && source_rect.size() == size; @@ -287,7 +287,7 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image, } void TextureUploader::UploadWithTexImageETC1(const uint8* image, - gfx::Size size) { + const gfx::Size& size) { TRACE_EVENT0("cc", "TextureUploader::UploadWithTexImageETC1"); DCHECK_EQ(0, size.width() % 4); DCHECK_EQ(0, size.height() % 4); diff --git a/cc/scheduler/texture_uploader.h b/cc/scheduler/texture_uploader.h index 362f001..709cb31 100644 --- a/cc/scheduler/texture_uploader.h +++ b/cc/scheduler/texture_uploader.h @@ -47,7 +47,7 @@ class CC_EXPORT TextureUploader { const gfx::Rect& source_rect, gfx::Vector2d dest_offset, ResourceFormat format, - gfx::Size size); + const gfx::Size& size); void Flush(); void ReleaseCachedQueries(); @@ -101,7 +101,7 @@ class CC_EXPORT TextureUploader { const gfx::Rect& source_rect, gfx::Vector2d dest_offset, ResourceFormat format); - void UploadWithTexImageETC1(const uint8* image, gfx::Size size); + void UploadWithTexImageETC1(const uint8* image, const gfx::Size& size); gpu::gles2::GLES2Interface* gl_; ScopedPtrDeque<Query> pending_queries_; diff --git a/cc/scheduler/texture_uploader_unittest.cc b/cc/scheduler/texture_uploader_unittest.cc index 792216c..7454f75 100644 --- a/cc/scheduler/texture_uploader_unittest.cc +++ b/cc/scheduler/texture_uploader_unittest.cc @@ -145,7 +145,7 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub { void UploadTexture(TextureUploader* uploader, ResourceFormat format, - gfx::Size size, + const gfx::Size& size, const uint8* data) { uploader->Upload(data, gfx::Rect(size), diff --git a/cc/test/fake_picture_layer_impl.cc b/cc/test/fake_picture_layer_impl.cc index 6e9ffde..4241ae0 100644 --- a/cc/test/fake_picture_layer_impl.cc +++ b/cc/test/fake_picture_layer_impl.cc @@ -36,7 +36,7 @@ void FakePictureLayerImpl::AppendQuads(QuadSink* quad_sink, } gfx::Size FakePictureLayerImpl::CalculateTileSize( - gfx::Size content_bounds) const { + const gfx::Size& content_bounds) const { if (fixed_tile_size_.IsEmpty()) { return PictureLayerImpl::CalculateTileSize(content_bounds); } diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h index a289934..477b6b9 100644 --- a/cc/test/fake_picture_layer_impl.h +++ b/cc/test/fake_picture_layer_impl.h @@ -26,7 +26,8 @@ class FakePictureLayerImpl : public PictureLayerImpl { OVERRIDE; virtual void AppendQuads(QuadSink* quad_sink, AppendQuadsData* append_quads_data) OVERRIDE; - virtual gfx::Size CalculateTileSize(gfx::Size content_bounds) const OVERRIDE; + virtual gfx::Size CalculateTileSize( + const gfx::Size& content_bounds) const OVERRIDE; using PictureLayerImpl::AddTiling; using PictureLayerImpl::CleanUpTilingsOnActiveLayer; @@ -54,7 +55,7 @@ class FakePictureLayerImpl : public PictureLayerImpl { const Region& invalidation() const { return invalidation_; } void set_invalidation(const Region& region) { invalidation_ = region; } - void set_fixed_tile_size(gfx::Size size) { fixed_tile_size_ = size; } + void set_fixed_tile_size(const gfx::Size& size) { fixed_tile_size_ = size; } void CreateDefaultTilingsAndTiles(); void SetAllTilesVisible(); diff --git a/cc/test/fake_picture_layer_tiling_client.cc b/cc/test/fake_picture_layer_tiling_client.cc index acbd791..f891b9e 100644 --- a/cc/test/fake_picture_layer_tiling_client.cc +++ b/cc/test/fake_picture_layer_tiling_client.cc @@ -49,12 +49,12 @@ scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile( pile_.get(), tile_size_, rect, gfx::Rect(), 1, 0, 0, Tile::USE_LCD_TEXT); } -void FakePictureLayerTilingClient::SetTileSize(gfx::Size tile_size) { +void FakePictureLayerTilingClient::SetTileSize(const gfx::Size& tile_size) { tile_size_ = tile_size; } gfx::Size FakePictureLayerTilingClient::CalculateTileSize( - gfx::Size /* content_bounds */) const { + const gfx::Size& /* content_bounds */) const { return tile_size_; } diff --git a/cc/test/fake_picture_layer_tiling_client.h b/cc/test/fake_picture_layer_tiling_client.h index 2e4e9d6..6383a22 100644 --- a/cc/test/fake_picture_layer_tiling_client.h +++ b/cc/test/fake_picture_layer_tiling_client.h @@ -25,9 +25,9 @@ class FakePictureLayerTilingClient : public PictureLayerTilingClient { PictureLayerTiling* tiling, const gfx::Rect& rect) OVERRIDE; virtual void UpdatePile(Tile* tile) OVERRIDE {} virtual gfx::Size CalculateTileSize( - gfx::Size content_bounds) const OVERRIDE; + const gfx::Size& content_bounds) const OVERRIDE; - void SetTileSize(gfx::Size tile_size); + void SetTileSize(const gfx::Size& tile_size); gfx::Size TileSize() const { return tile_size_; } scoped_refptr<PicturePileImpl> pile() { return pile_; } const PicturePileImpl* pile() const { return pile_.get(); } diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc index bc751ed..9b168e6 100644 --- a/cc/test/fake_picture_pile_impl.cc +++ b/cc/test/fake_picture_pile_impl.cc @@ -17,8 +17,8 @@ FakePicturePileImpl::FakePicturePileImpl() {} FakePicturePileImpl::~FakePicturePileImpl() {} scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile( - gfx::Size tile_size, - gfx::Size layer_bounds) { + const gfx::Size& tile_size, + const gfx::Size& layer_bounds) { scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl()); pile->tiling().SetTotalSize(layer_bounds); pile->tiling().SetMaxTextureSize(tile_size); @@ -32,8 +32,8 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile( } scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile( - gfx::Size tile_size, - gfx::Size layer_bounds) { + const gfx::Size& tile_size, + const gfx::Size& layer_bounds) { scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl()); pile->tiling().SetTotalSize(layer_bounds); pile->tiling().SetMaxTextureSize(tile_size); @@ -44,8 +44,8 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile( scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreatePileWithRecordedRegion( - gfx::Size tile_size, - gfx::Size layer_bounds, + const gfx::Size& tile_size, + const gfx::Size& layer_bounds, const Region& recorded_region) { scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl()); pile->tiling().SetTotalSize(layer_bounds); diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h index 20d44e3..ae424bb 100644 --- a/cc/test/fake_picture_pile_impl.h +++ b/cc/test/fake_picture_pile_impl.h @@ -14,16 +14,16 @@ namespace cc { class FakePicturePileImpl : public PicturePileImpl { public: static scoped_refptr<FakePicturePileImpl> CreateFilledPile( - gfx::Size tile_size, - gfx::Size layer_bounds); + const gfx::Size& tile_size, + const gfx::Size& layer_bounds); static scoped_refptr<FakePicturePileImpl> CreateEmptyPile( - gfx::Size tile_size, - gfx::Size layer_bounds); + const gfx::Size& tile_size, + const gfx::Size& layer_bounds); static scoped_refptr<FakePicturePileImpl> CreatePileWithRecordedRegion( - gfx::Size tile_size, - gfx::Size layer_bounds, + const gfx::Size& tile_size, + const gfx::Size& layer_bounds, const Region& recorded_region); static scoped_refptr<FakePicturePileImpl> CreatePile(); diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc index 806b877..c5d2125 100644 --- a/cc/test/layer_tree_pixel_test.cc +++ b/cc/test/layer_tree_pixel_test.cc @@ -228,7 +228,7 @@ void LayerTreePixelTest::SetupTree() { } scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap( - gfx::Size size, + const gfx::Size& size, const TextureMailbox& texture_mailbox) { DCHECK(texture_mailbox.IsTexture()); if (!texture_mailbox.IsTexture()) diff --git a/cc/test/layer_tree_pixel_test.h b/cc/test/layer_tree_pixel_test.h index a72f1db..426cd02 100644 --- a/cc/test/layer_tree_pixel_test.h +++ b/cc/test/layer_tree_pixel_test.h @@ -75,7 +75,7 @@ class LayerTreePixelTest : public LayerTreeTest { base::FilePath file_name); scoped_ptr<SkBitmap> CopyTextureMailboxToBitmap( - gfx::Size size, + const gfx::Size& size, const TextureMailbox& texture_mailbox); void CopyBitmapToTextureMailboxAsTexture( diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc index 1257be6..e84540e 100644 --- a/cc/test/pixel_test.cc +++ b/cc/test/pixel_test.cc @@ -137,7 +137,7 @@ void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { 0).PassAs<DirectRenderer>(); } -void PixelTest::ForceExpandedViewport(gfx::Size surface_expansion) { +void PixelTest::ForceExpandedViewport(const gfx::Size& surface_expansion) { static_cast<PixelTestOutputSurface*>(output_surface_.get()) ->set_surface_expansion_size(surface_expansion); SoftwareOutputDevice* device = output_surface_->software_device(); diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h index b6e0242..6d5c552 100644 --- a/cc/test/pixel_test.h +++ b/cc/test/pixel_test.h @@ -59,7 +59,7 @@ class PixelTest : public testing::Test, RendererClient { void SetUpGLRenderer(bool use_skia_gpu_backend); void SetUpSoftwareRenderer(); - void ForceExpandedViewport(gfx::Size surface_expansion); + void ForceExpandedViewport(const gfx::Size& surface_expansion); void ForceViewportOffset(gfx::Vector2d viewport_offset); void ForceDeviceClip(const gfx::Rect& clip); void EnableExternalStencilTest(); diff --git a/cc/test/pixel_test_output_surface.cc b/cc/test/pixel_test_output_surface.cc index e3f62bd..c773a52 100644 --- a/cc/test/pixel_test_output_surface.cc +++ b/cc/test/pixel_test_output_surface.cc @@ -17,7 +17,8 @@ PixelTestOutputSurface::PixelTestOutputSurface( scoped_ptr<SoftwareOutputDevice> software_device) : OutputSurface(software_device.Pass()), external_stencil_test_(false) {} -void PixelTestOutputSurface::Reshape(gfx::Size size, float scale_factor) { +void PixelTestOutputSurface::Reshape(const gfx::Size& size, + float scale_factor) { gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), size.height() + surface_expansion_size_.height()); OutputSurface::Reshape(expanded_size, scale_factor); diff --git a/cc/test/pixel_test_output_surface.h b/cc/test/pixel_test_output_surface.h index 2a4573a..d3ec612 100644 --- a/cc/test/pixel_test_output_surface.h +++ b/cc/test/pixel_test_output_surface.h @@ -16,10 +16,10 @@ class PixelTestOutputSurface : public OutputSurface { explicit PixelTestOutputSurface( scoped_ptr<SoftwareOutputDevice> software_device); - virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE; + virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; virtual bool HasExternalStencilTest() const OVERRIDE; - void set_surface_expansion_size(gfx::Size surface_expansion_size) { + void set_surface_expansion_size(const gfx::Size& surface_expansion_size) { surface_expansion_size_ = surface_expansion_size; } void set_has_external_stencil_test(bool has_test) { diff --git a/cc/test/pixel_test_software_output_device.cc b/cc/test/pixel_test_software_output_device.cc index d4f0b88..a8d986c 100644 --- a/cc/test/pixel_test_software_output_device.cc +++ b/cc/test/pixel_test_software_output_device.cc @@ -6,7 +6,7 @@ namespace cc { -void PixelTestSoftwareOutputDevice::Resize(gfx::Size size) { +void PixelTestSoftwareOutputDevice::Resize(const gfx::Size& size) { gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), size.height() + surface_expansion_size_.height()); SoftwareOutputDevice::Resize(expanded_size); diff --git a/cc/test/pixel_test_software_output_device.h b/cc/test/pixel_test_software_output_device.h index b652063..7c1dae6 100644 --- a/cc/test/pixel_test_software_output_device.h +++ b/cc/test/pixel_test_software_output_device.h @@ -11,9 +11,9 @@ namespace cc { class PixelTestSoftwareOutputDevice : public SoftwareOutputDevice { public: - virtual void Resize(gfx::Size size) OVERRIDE; + virtual void Resize(const gfx::Size& size) OVERRIDE; - void set_surface_expansion_size(gfx::Size surface_expansion_size) { + void set_surface_expansion_size(const gfx::Size& surface_expansion_size) { surface_expansion_size_ = surface_expansion_size; } diff --git a/cc/test/skia_common.cc b/cc/test/skia_common.cc index dfccd64..277a124 100644 --- a/cc/test/skia_common.cc +++ b/cc/test/skia_common.cc @@ -25,7 +25,7 @@ void DrawPicture(unsigned char* buffer, picture->Raster(&canvas, NULL, layer_rect, 1.0f); } -void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) { +void CreateBitmap(const gfx::Size& size, const char* uri, SkBitmap* bitmap) { SkImageInfo info = { size.width(), size.height(), diff --git a/cc/test/skia_common.h b/cc/test/skia_common.h index 3424799..3bafa0b 100644 --- a/cc/test/skia_common.h +++ b/cc/test/skia_common.h @@ -23,7 +23,7 @@ void DrawPicture(unsigned char* buffer, const gfx::Rect& layer_rect, scoped_refptr<Picture> picture); -void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap); +void CreateBitmap(const gfx::Size& size, const char* uri, SkBitmap* bitmap); } // namespace cc diff --git a/cc/test/test_texture.cc b/cc/test/test_texture.cc index 0f4f07c..8addc79 100644 --- a/cc/test/test_texture.cc +++ b/cc/test/test_texture.cc @@ -9,7 +9,7 @@ namespace cc { -size_t TextureSizeBytes(gfx::Size size, ResourceFormat format) { +size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format) { unsigned int components_per_pixel = 4; unsigned int bytes_per_component = 1; return size.width() * size.height() * components_per_pixel * @@ -28,7 +28,7 @@ TestTexture::TestTexture() : format(RGBA_8888) { TestTexture::~TestTexture() {} -void TestTexture::Reallocate(gfx::Size size, ResourceFormat format) { +void TestTexture::Reallocate(const gfx::Size& size, ResourceFormat format) { this->size = size; this->format = format; this->data.reset(new uint8_t[TextureSizeBytes(size, format)]); diff --git a/cc/test/test_texture.h b/cc/test/test_texture.h index f5070e1..0e50bf0 100644 --- a/cc/test/test_texture.h +++ b/cc/test/test_texture.h @@ -14,12 +14,12 @@ namespace cc { -size_t TextureSizeBytes(gfx::Size size, ResourceFormat format); +size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format); struct TestTexture : public base::RefCounted<TestTexture> { TestTexture(); - void Reallocate(gfx::Size size, ResourceFormat format); + void Reallocate(const gfx::Size& size, ResourceFormat format); bool IsValidParameter(GLenum pname); gfx::Size size; diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc index 6dddfd3..e39765e 100644 --- a/cc/test/tiled_layer_test_common.cc +++ b/cc/test/tiled_layer_test_common.cc @@ -35,7 +35,7 @@ FakeLayerUpdater::FakeLayerUpdater() : prepare_count_(0), update_count_(0) {} FakeLayerUpdater::~FakeLayerUpdater() {} void FakeLayerUpdater::PrepareToUpdate(const gfx::Rect& content_rect, - gfx::Size tile_size, + const gfx::Size& tile_size, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) { @@ -148,7 +148,7 @@ LayerUpdater* FakeTiledLayer::Updater() const { } void FakeTiledLayerWithScaledBounds::SetContentBounds( - gfx::Size content_bounds) { + const gfx::Size& content_bounds) { forced_content_bounds_ = content_bounds; draw_properties().content_bounds = forced_content_bounds_; } diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h index 17de629..1e1aace 100644 --- a/cc/test/tiled_layer_test_common.h +++ b/cc/test/tiled_layer_test_common.h @@ -46,7 +46,7 @@ class FakeLayerUpdater : public LayerUpdater { PrioritizedResourceManager* resource) OVERRIDE; virtual void PrepareToUpdate(const gfx::Rect& content_rect, - gfx::Size tile_size, + const gfx::Size& tile_size, float contents_width_scale, float contents_height_scale, gfx::Rect* resulting_opaque_rect) OVERRIDE; @@ -139,7 +139,7 @@ class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { explicit FakeTiledLayerWithScaledBounds( PrioritizedResourceManager* resource_manager); - void SetContentBounds(gfx::Size content_bounds); + void SetContentBounds(const gfx::Size& content_bounds); virtual void CalculateContentsScale(float ideal_contents_scale, float device_scale_factor, float page_scale_factor, diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 0684a9c..2c17cac 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -638,7 +638,7 @@ void LayerTreeHost::SetDebugState(const LayerTreeDebugState& debug_state) { SetNeedsCommit(); } -void LayerTreeHost::SetViewportSize(gfx::Size device_viewport_size) { +void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) { if (device_viewport_size == device_viewport_size_) return; diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 867bb19..76dc680 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -201,7 +201,7 @@ class CC_EXPORT LayerTreeHost { void SetDebugState(const LayerTreeDebugState& debug_state); const LayerTreeDebugState& debug_state() const { return debug_state_; } - void SetViewportSize(gfx::Size device_viewport_size); + void SetViewportSize(const gfx::Size& device_viewport_size); void SetOverdrawBottomHeight(float overdraw_bottom_height); gfx::Size device_viewport_size() const { return device_viewport_size_; } diff --git a/cc/trees/layer_tree_host_common.h b/cc/trees/layer_tree_host_common.h index cd30b93..57ea16d 100644 --- a/cc/trees/layer_tree_host_common.h +++ b/cc/trees/layer_tree_host_common.h @@ -32,7 +32,7 @@ class CC_EXPORT LayerTreeHostCommon { struct CalcDrawPropsInputs { public: CalcDrawPropsInputs(LayerType* root_layer, - gfx::Size device_viewport_size, + const gfx::Size& device_viewport_size, const gfx::Transform& device_transform, float device_scale_factor, float page_scale_factor, @@ -72,12 +72,12 @@ class CC_EXPORT LayerTreeHostCommon { : public CalcDrawPropsInputs<LayerType, RenderSurfaceLayerListType> { CalcDrawPropsInputsForTesting( LayerType* root_layer, - gfx::Size device_viewport_size, + const gfx::Size& device_viewport_size, const gfx::Transform& device_transform, RenderSurfaceLayerListType* render_surface_layer_list); CalcDrawPropsInputsForTesting( LayerType* root_layer, - gfx::Size device_viewport_size, + const gfx::Size& device_viewport_size, RenderSurfaceLayerListType* render_surface_layer_list); private: @@ -126,7 +126,7 @@ class CC_EXPORT LayerTreeHostCommon { // given transform. template <typename LayerType> static void ApplySublayerTransformAboutAnchor(const LayerType& layer, - gfx::Size bounds, + const gfx::Size& bounds, gfx::Transform* transform) { if (!layer.sublayer_transform().IsIdentity()) { transform->Translate(layer.anchor_point().x() * bounds.width(), @@ -227,7 +227,7 @@ LayerTreeHostCommon::CalcDrawPropsInputsForTesting<LayerType, RenderSurfaceLayerListType>:: CalcDrawPropsInputsForTesting( LayerType* root_layer, - gfx::Size device_viewport_size, + const gfx::Size& device_viewport_size, const gfx::Transform& device_transform, RenderSurfaceLayerListType* render_surface_layer_list) : CalcDrawPropsInputs<LayerType, RenderSurfaceLayerListType>( @@ -251,7 +251,7 @@ LayerTreeHostCommon::CalcDrawPropsInputsForTesting<LayerType, RenderSurfaceLayerListType>:: CalcDrawPropsInputsForTesting( LayerType* root_layer, - gfx::Size device_viewport_size, + const gfx::Size& device_viewport_size, RenderSurfaceLayerListType* render_surface_layer_list) : CalcDrawPropsInputs<LayerType, RenderSurfaceLayerListType>( root_layer, diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index f7db3e1..3a71b3d 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -44,7 +44,7 @@ class LayerTreeHostCommonTestBase { const gfx::Transform& sublayer_transform, const gfx::PointF& anchor, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool preserves3d) { layer->SetTransform(transform); layer->SetSublayerTransform(sublayer_transform); @@ -59,7 +59,7 @@ class LayerTreeHostCommonTestBase { const gfx::Transform& sublayer_transform, const gfx::PointF& anchor, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool preserves3d) { SetLayerPropertiesForTestingInternal<Layer>(layer, transform, @@ -75,7 +75,7 @@ class LayerTreeHostCommonTestBase { const gfx::Transform& sublayer_transform, const gfx::PointF& anchor, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool preserves3d) { SetLayerPropertiesForTestingInternal<LayerImpl>(layer, transform, diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 9063caf..146c0e0 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1899,7 +1899,7 @@ void LayerTreeHostImpl::ReleaseGL() { client_->SetNeedsCommitOnImplThread(); } -void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { +void LayerTreeHostImpl::SetViewportSize(const gfx::Size& device_viewport_size) { if (device_viewport_size == device_viewport_size_) return; @@ -1925,7 +1925,7 @@ void LayerTreeHostImpl::SetOverdrawBottomHeight(float overdraw_bottom_height) { void LayerTreeHostImpl::SetOverhangUIResource( UIResourceId overhang_ui_resource_id, - gfx::Size overhang_ui_resource_size) { + const gfx::Size& overhang_ui_resource_size) { overhang_ui_resource_id_ = overhang_ui_resource_id; overhang_ui_resource_size_ = overhang_ui_resource_size; } diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 2b85e32..3b8e65b 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -297,13 +297,13 @@ class CC_EXPORT LayerTreeHostImpl size_t memory_allocation_limit_bytes() const; int memory_allocation_priority_cutoff() const; - void SetViewportSize(gfx::Size device_viewport_size); + void SetViewportSize(const gfx::Size& device_viewport_size); void SetOverdrawBottomHeight(float overdraw_bottom_height); float overdraw_bottom_height() const { return overdraw_bottom_height_; } void SetOverhangUIResource(UIResourceId overhang_ui_resource_id, - gfx::Size overhang_ui_resource_size); + const gfx::Size& overhang_ui_resource_size); void SetDeviceScaleFactor(float device_scale_factor); float device_scale_factor() const { return device_scale_factor_; } diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 4797541..6825599 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -204,7 +204,7 @@ class LayerTreeHostImplTest : public testing::Test, } LayerImpl* CreateScrollAndContentsLayers(LayerTreeImpl* layer_tree_impl, - gfx::Size content_size) { + const gfx::Size& content_size) { scoped_ptr<LayerImpl> root = LayerImpl::Create(layer_tree_impl, 1); root->SetBounds(content_size); @@ -239,14 +239,14 @@ class LayerTreeHostImplTest : public testing::Test, return scroll_layer; } - LayerImpl* SetupScrollAndContentsLayers(gfx::Size content_size) { + LayerImpl* SetupScrollAndContentsLayers(const gfx::Size& content_size) { LayerImpl* scroll_layer = CreateScrollAndContentsLayers( host_impl_->active_tree(), content_size); host_impl_->active_tree()->DidBecomeActive(); return scroll_layer; } - scoped_ptr<LayerImpl> CreateScrollableLayer(int id, gfx::Size size) { + scoped_ptr<LayerImpl> CreateScrollableLayer(int id, const gfx::Size& size) { scoped_ptr<LayerImpl> layer = LayerImpl::Create(host_impl_->active_tree(), id); layer->SetScrollable(true); @@ -3169,7 +3169,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { void set_gutter_quad_material(DrawQuad::Material material) { gutter_quad_material_ = material; } - void set_gutter_texture_size(gfx::Size gutter_texture_size) { + void set_gutter_texture_size(const gfx::Size& gutter_texture_size) { gutter_texture_size_ = gutter_texture_size; } @@ -3207,7 +3207,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { } } - gfx::Size DipSizeToPixelSize(gfx::Size size) { + gfx::Size DipSizeToPixelSize(const gfx::Size& size) { return gfx::ToRoundedSize( gfx::ScaleSize(size, host_impl_->device_scale_factor())); } diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 5737b42..dd241af 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -1594,7 +1594,7 @@ static void SetLayerPropertiesForTesting(Layer* layer, const gfx::Transform& transform, const gfx::PointF& anchor, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool opaque) { layer->RemoveAllChildren(); if (parent) diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc index a5f1b32..491b42f1 100644 --- a/cc/trees/layer_tree_host_unittest_occlusion.cc +++ b/cc/trees/layer_tree_host_unittest_occlusion.cc @@ -87,7 +87,7 @@ class LayerTreeHostOcclusionTest : public LayerTreeTest { TestLayer* parent, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool opaque) const { layer->RemoveAllChildren(); if (parent) diff --git a/cc/trees/occlusion_tracker.h b/cc/trees/occlusion_tracker.h index 85334bc..2fe54d0 100644 --- a/cc/trees/occlusion_tracker.h +++ b/cc/trees/occlusion_tracker.h @@ -82,7 +82,7 @@ class CC_EXPORT OcclusionTrackerBase { stack_.back().occlusion_from_inside_target); } - void set_minimum_tracking_size(gfx::Size size) { + void set_minimum_tracking_size(const gfx::Size& size) { minimum_tracking_size_ = size; } diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index 6b66c28..9c6fa45 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -201,7 +201,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::ContentLayerType* CreateRoot(const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { typename Types::ContentLayerPtrType layer( Types::CreateContentLayer(GetHost())); typename Types::ContentLayerType* layer_ptr = layer.get(); @@ -218,7 +218,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::LayerType* CreateLayer(typename Types::LayerType* parent, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { typename Types::LayerPtrType layer(Types::CreateLayer(GetHost())); typename Types::LayerType* layer_ptr = layer.get(); SetProperties(layer_ptr, transform, position, bounds); @@ -229,7 +229,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::LayerType* CreateSurface(typename Types::LayerType* parent, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { typename Types::LayerType* layer = CreateLayer(parent, transform, position, bounds); layer->SetForceRenderSurface(true); @@ -240,7 +240,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::LayerType* parent, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool opaque) { typename Types::ContentLayerPtrType layer( Types::CreateContentLayer(GetHost())); @@ -265,7 +265,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::LayerType* owning_layer, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { typename Types::ContentLayerPtrType layer( Types::CreateContentLayer(GetHost())); typename Types::ContentLayerType* layer_ptr = layer.get(); @@ -276,7 +276,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::LayerType* CreateMaskLayer( typename Types::LayerType* owning_layer, - gfx::Size bounds) { + const gfx::Size& bounds) { typename Types::ContentLayerPtrType layer( Types::CreateContentLayer(GetHost())); typename Types::ContentLayerType* layer_ptr = layer.get(); @@ -289,7 +289,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { typename Types::LayerType* parent, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds, + const gfx::Size& bounds, bool opaque) { typename Types::ContentLayerType* layer = CreateDrawingLayer(parent, transform, position, bounds, opaque); @@ -414,7 +414,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { void SetBaseProperties(typename Types::LayerType* layer, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { layer->SetTransform(transform); layer->SetSublayerTransform(gfx::Transform()); layer->SetAnchorPoint(gfx::PointF()); @@ -425,14 +425,14 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test { void SetProperties(Layer* layer, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { SetBaseProperties(layer, transform, position, bounds); } void SetProperties(LayerImpl* layer, const gfx::Transform& transform, const gfx::PointF& position, - gfx::Size bounds) { + const gfx::Size& bounds) { SetBaseProperties(layer, transform, position, bounds); layer->SetContentBounds(layer->bounds()); diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc index 2058fd1..3f7e5a2 100644 --- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc @@ -75,7 +75,7 @@ class SynchronousCompositorOutputSurface::SoftwareDevice null_device_(SkBitmap::kARGB_8888_Config, 1, 1), null_canvas_(&null_device_) { } - virtual void Resize(gfx::Size size) OVERRIDE { + virtual void Resize(const gfx::Size& size) OVERRIDE { // Intentional no-op: canvas size is controlled by the embedder. } virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE { @@ -156,7 +156,7 @@ bool SynchronousCompositorOutputSurface::BindToClient( } void SynchronousCompositorOutputSurface::Reshape( - gfx::Size size, float scale_factor) { + const gfx::Size& size, float scale_factor) { // Intentional no-op: surface size is controlled by the embedder. } diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.h b/content/browser/android/in_process/synchronous_compositor_output_surface.h index 2879de0..5b62fd5 100644 --- a/content/browser/android/in_process/synchronous_compositor_output_surface.h +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.h @@ -58,7 +58,7 @@ class SynchronousCompositorOutputSurface // OutputSurface. virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE; virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; - virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE; + virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; virtual void SetNeedsBeginImplFrame(bool enable) OVERRIDE; virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; diff --git a/content/browser/compositor/browser_compositor_output_surface.cc b/content/browser/compositor/browser_compositor_output_surface.cc index d3ceb2a..30ff485 100644 --- a/content/browser/compositor/browser_compositor_output_surface.cc +++ b/content/browser/compositor/browser_compositor_output_surface.cc @@ -80,7 +80,7 @@ bool BrowserCompositorOutputSurface::BindToClient( return true; } -void BrowserCompositorOutputSurface::Reshape(gfx::Size size, +void BrowserCompositorOutputSurface::Reshape(const gfx::Size& size, float scale_factor) { OutputSurface::Reshape(size, scale_factor); if (reflector_.get()) diff --git a/content/browser/compositor/browser_compositor_output_surface.h b/content/browser/compositor/browser_compositor_output_surface.h index de7ea9b..bf0e366 100644 --- a/content/browser/compositor/browser_compositor_output_surface.h +++ b/content/browser/compositor/browser_compositor_output_surface.h @@ -32,7 +32,7 @@ class CONTENT_EXPORT BrowserCompositorOutputSurface // cc::OutputSurface implementation. virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; - virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE; + virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; void OnUpdateVSyncParameters(base::TimeTicks timebase, base::TimeDelta interval); diff --git a/content/browser/compositor/software_output_device_win.cc b/content/browser/compositor/software_output_device_win.cc index 72f2474..a65b7e0 100644 --- a/content/browser/compositor/software_output_device_win.cc +++ b/content/browser/compositor/software_output_device_win.cc @@ -29,7 +29,7 @@ SoftwareOutputDeviceWin::~SoftwareOutputDeviceWin() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } -void SoftwareOutputDeviceWin::Resize(gfx::Size viewport_size) { +void SoftwareOutputDeviceWin::Resize(const gfx::Size& viewport_size) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (viewport_size_ == viewport_size) diff --git a/content/browser/compositor/software_output_device_win.h b/content/browser/compositor/software_output_device_win.h index 4362732..00b238c 100644 --- a/content/browser/compositor/software_output_device_win.h +++ b/content/browser/compositor/software_output_device_win.h @@ -25,7 +25,7 @@ class SoftwareOutputDeviceWin : public cc::SoftwareOutputDevice { explicit SoftwareOutputDeviceWin(ui::Compositor* compositor); virtual ~SoftwareOutputDeviceWin(); - virtual void Resize(gfx::Size viewport_size) OVERRIDE; + virtual void Resize(const gfx::Size& viewport_size) OVERRIDE; virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE; virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE; virtual void CopyToBitmap(const gfx::Rect& rect, SkBitmap* output) OVERRIDE; diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index 0b4eb58..b85de07 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc @@ -60,7 +60,7 @@ class DirectOutputSurface : public cc::OutputSurface { capabilities_.adjust_deadline_for_parent = false; } - virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE { + virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE { surface_size_ = size; } virtual void SwapBuffers(cc::CompositorFrame*) OVERRIDE { diff --git a/content/renderer/gpu/compositor_software_output_device.cc b/content/renderer/gpu/compositor_software_output_device.cc index e400060..e93367c 100644 --- a/content/renderer/gpu/compositor_software_output_device.cc +++ b/content/renderer/gpu/compositor_software_output_device.cc @@ -97,7 +97,7 @@ size_t CompositorSoftwareOutputDevice::FindFreeBuffer(size_t hint) { return buffers_.size() - 1; } -void CompositorSoftwareOutputDevice::Resize(gfx::Size viewport_size) { +void CompositorSoftwareOutputDevice::Resize(const gfx::Size& viewport_size) { DCHECK(CalledOnValidThread()); if (viewport_size_ == viewport_size) diff --git a/content/renderer/gpu/compositor_software_output_device.h b/content/renderer/gpu/compositor_software_output_device.h index 5804baf..c04f4f1 100644 --- a/content/renderer/gpu/compositor_software_output_device.h +++ b/content/renderer/gpu/compositor_software_output_device.h @@ -26,7 +26,7 @@ public: CompositorSoftwareOutputDevice(); virtual ~CompositorSoftwareOutputDevice(); - virtual void Resize(gfx::Size size) OVERRIDE; + virtual void Resize(const gfx::Size& size) OVERRIDE; virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE; virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE; diff --git a/content/renderer/gpu/mailbox_output_surface.cc b/content/renderer/gpu/mailbox_output_surface.cc index 7031be6..ec5d00b 100644 --- a/content/renderer/gpu/mailbox_output_surface.cc +++ b/content/renderer/gpu/mailbox_output_surface.cc @@ -118,7 +118,7 @@ void MailboxOutputSurface::DiscardBackbuffer() { } } -void MailboxOutputSurface::Reshape(gfx::Size size, float scale_factor) { +void MailboxOutputSurface::Reshape(const gfx::Size& size, float scale_factor) { if (size == surface_size_) return; diff --git a/content/renderer/gpu/mailbox_output_surface.h b/content/renderer/gpu/mailbox_output_surface.h index 0ad9699..2a8e278 100644 --- a/content/renderer/gpu/mailbox_output_surface.h +++ b/content/renderer/gpu/mailbox_output_surface.h @@ -35,7 +35,7 @@ class MailboxOutputSurface : public CompositorOutputSurface { // cc::OutputSurface implementation. virtual void EnsureBackbuffer() OVERRIDE; virtual void DiscardBackbuffer() OVERRIDE; - virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE; + virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; virtual void BindFramebuffer() OVERRIDE; virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |