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

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

Issue 1155553006: Revert of cc: Fix size_t to int truncations in layers/ output/ playback/ quads/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_iterator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/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"
9 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
11 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
12 #include "cc/animation/animation_registrar.h" 11 #include "cc/animation/animation_registrar.h"
13 #include "cc/animation/scrollbar_animation_controller.h" 12 #include "cc/animation/scrollbar_animation_controller.h"
14 #include "cc/base/math_util.h" 13 #include "cc/base/math_util.h"
15 #include "cc/base/simple_enclosed_region.h" 14 #include "cc/base/simple_enclosed_region.h"
16 #include "cc/debug/debug_colors.h" 15 #include "cc/debug/debug_colors.h"
17 #include "cc/debug/layer_tree_debug_state.h" 16 #include "cc/debug/layer_tree_debug_state.h"
18 #include "cc/debug/micro_benchmark_impl.h" 17 #include "cc/debug/micro_benchmark_impl.h"
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 LayerTypeAsString(), 1508 LayerTypeAsString(),
1510 this); 1509 this);
1511 state->SetInteger("layer_id", id()); 1510 state->SetInteger("layer_id", id());
1512 MathUtil::AddToTracedValue("bounds", bounds_, state); 1511 MathUtil::AddToTracedValue("bounds", bounds_, state);
1513 1512
1514 state->SetDouble("opacity", opacity()); 1513 state->SetDouble("opacity", opacity());
1515 1514
1516 MathUtil::AddToTracedValue("position", position_, state); 1515 MathUtil::AddToTracedValue("position", position_, state);
1517 1516
1518 state->SetInteger("draws_content", DrawsContent()); 1517 state->SetInteger("draws_content", DrawsContent());
1519 state->SetInteger("gpu_memory_usage", 1518 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
1520 base::saturated_cast<int>(GPUMemoryUsageInBytes()));
1521 1519
1522 MathUtil::AddToTracedValue( 1520 MathUtil::AddToTracedValue(
1523 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive()) 1521 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive())
1524 : gfx::ScrollOffset(), 1522 : gfx::ScrollOffset(),
1525 state); 1523 state);
1526 1524
1527 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); 1525 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state);
1528 1526
1529 bool clipped; 1527 bool clipped;
1530 gfx::QuadF layer_quad = MathUtil::MapQuad( 1528 gfx::QuadF layer_quad = MathUtil::MapQuad(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 gfx::Transform scaled_draw_transform = 1675 gfx::Transform scaled_draw_transform =
1678 draw_properties_.target_space_transform; 1676 draw_properties_.target_space_transform;
1679 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1677 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1680 gfx::Size scaled_content_bounds = 1678 gfx::Size scaled_content_bounds =
1681 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); 1679 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale));
1682 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1680 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1683 gfx::Rect(scaled_content_bounds)); 1681 gfx::Rect(scaled_content_bounds));
1684 } 1682 }
1685 1683
1686 } // namespace cc 1684 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698