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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 1231453002: Compute if a layer is clipped outside CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment on Patch 1 Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/numerics/safe_conversions.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 510
511 skia::RefPtr<SkPicture> LayerImpl::GetPicture() { 511 skia::RefPtr<SkPicture> LayerImpl::GetPicture() {
512 return skia::RefPtr<SkPicture>(); 512 return skia::RefPtr<SkPicture>();
513 } 513 }
514 514
515 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { 515 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) {
516 return LayerImpl::Create(tree_impl, layer_id_, scroll_offset_); 516 return LayerImpl::Create(tree_impl, layer_id_, scroll_offset_);
517 } 517 }
518 518
519 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { 519 void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
520 layer->draw_properties().is_clipped_from_property_trees =
521 draw_properties_.is_clipped_from_property_trees;
520 layer->SetTransformOrigin(transform_origin_); 522 layer->SetTransformOrigin(transform_origin_);
521 layer->SetBackgroundColor(background_color_); 523 layer->SetBackgroundColor(background_color_);
522 layer->SetBounds(bounds_); 524 layer->SetBounds(bounds_);
523 layer->SetDoubleSided(double_sided_); 525 layer->SetDoubleSided(double_sided_);
524 layer->SetDrawCheckerboardForMissingTiles( 526 layer->SetDrawCheckerboardForMissingTiles(
525 draw_checkerboard_for_missing_tiles_); 527 draw_checkerboard_for_missing_tiles_);
526 layer->SetDrawsContent(DrawsContent()); 528 layer->SetDrawsContent(DrawsContent());
527 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); 529 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_);
528 layer->SetHasRenderSurface(!!render_surface()); 530 layer->SetHasRenderSurface(!!render_surface());
529 layer->SetFilters(filters()); 531 layer->SetFilters(filters());
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 gfx::Rect LayerImpl::GetScaledEnclosingRectInTargetSpace(float scale) const { 1790 gfx::Rect LayerImpl::GetScaledEnclosingRectInTargetSpace(float scale) const {
1789 gfx::Transform scaled_draw_transform = 1791 gfx::Transform scaled_draw_transform =
1790 draw_properties_.target_space_transform; 1792 draw_properties_.target_space_transform;
1791 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1793 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1792 gfx::Size scaled_bounds = gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale)); 1794 gfx::Size scaled_bounds = gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale));
1793 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1795 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1794 gfx::Rect(scaled_bounds)); 1796 gfx::Rect(scaled_bounds));
1795 } 1797 }
1796 1798
1797 } // namespace cc 1799 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698