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

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

Issue 1158433010: Reland: 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
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/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 11 #include "base/trace_event/trace_event_argument.h"
11 #include "cc/animation/animation_registrar.h" 12 #include "cc/animation/animation_registrar.h"
12 #include "cc/animation/scrollbar_animation_controller.h" 13 #include "cc/animation/scrollbar_animation_controller.h"
13 #include "cc/base/math_util.h" 14 #include "cc/base/math_util.h"
14 #include "cc/base/simple_enclosed_region.h" 15 #include "cc/base/simple_enclosed_region.h"
15 #include "cc/debug/debug_colors.h" 16 #include "cc/debug/debug_colors.h"
16 #include "cc/debug/layer_tree_debug_state.h" 17 #include "cc/debug/layer_tree_debug_state.h"
17 #include "cc/debug/micro_benchmark_impl.h" 18 #include "cc/debug/micro_benchmark_impl.h"
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 LayerTypeAsString(), 1509 LayerTypeAsString(),
1509 this); 1510 this);
1510 state->SetInteger("layer_id", id()); 1511 state->SetInteger("layer_id", id());
1511 MathUtil::AddToTracedValue("bounds", bounds_, state); 1512 MathUtil::AddToTracedValue("bounds", bounds_, state);
1512 1513
1513 state->SetDouble("opacity", opacity()); 1514 state->SetDouble("opacity", opacity());
1514 1515
1515 MathUtil::AddToTracedValue("position", position_, state); 1516 MathUtil::AddToTracedValue("position", position_, state);
1516 1517
1517 state->SetInteger("draws_content", DrawsContent()); 1518 state->SetInteger("draws_content", DrawsContent());
1518 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); 1519 state->SetInteger("gpu_memory_usage",
1520 base::saturated_cast<int>(GPUMemoryUsageInBytes()));
1519 1521
1520 MathUtil::AddToTracedValue( 1522 MathUtil::AddToTracedValue(
1521 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive()) 1523 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive())
1522 : gfx::ScrollOffset(), 1524 : gfx::ScrollOffset(),
1523 state); 1525 state);
1524 1526
1525 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); 1527 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state);
1526 1528
1527 bool clipped; 1529 bool clipped;
1528 gfx::QuadF layer_quad = MathUtil::MapQuad( 1530 gfx::QuadF layer_quad = MathUtil::MapQuad(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 gfx::Transform scaled_draw_transform = 1677 gfx::Transform scaled_draw_transform =
1676 draw_properties_.target_space_transform; 1678 draw_properties_.target_space_transform;
1677 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1679 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1678 gfx::Size scaled_content_bounds = 1680 gfx::Size scaled_content_bounds =
1679 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); 1681 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale));
1680 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1682 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1681 gfx::Rect(scaled_content_bounds)); 1683 gfx::Rect(scaled_content_bounds));
1682 } 1684 }
1683 1685
1684 } // namespace cc 1686 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_iterator.h » ('j') | cc/output/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698