OLD | NEW |
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/resources/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/debug/trace_event_argument.h" | 12 #include "base/debug/trace_event_argument.h" |
13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "cc/debug/devtools_instrumentation.h" | 16 #include "cc/debug/devtools_instrumentation.h" |
17 #include "cc/debug/frame_viewer_instrumentation.h" | 17 #include "cc/debug/frame_viewer_instrumentation.h" |
18 #include "cc/debug/traced_value.h" | 18 #include "cc/debug/traced_value.h" |
19 #include "cc/layers/picture_layer_impl.h" | 19 #include "cc/layers/picture_layer_impl.h" |
20 #include "cc/resources/raster_buffer.h" | 20 #include "cc/resources/raster_buffer.h" |
21 #include "cc/resources/rasterizer.h" | 21 #include "cc/resources/rasterizer.h" |
22 #include "cc/resources/tile.h" | 22 #include "cc/resources/tile.h" |
23 #include "ui/gfx/rect_conversions.h" | 23 #include "ui/gfx/geometry/rect_conversions.h" |
24 | 24 |
25 namespace cc { | 25 namespace cc { |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Flag to indicate whether we should try and detect that | 28 // Flag to indicate whether we should try and detect that |
29 // a tile is of solid color. | 29 // a tile is of solid color. |
30 const bool kUseColorEstimator = true; | 30 const bool kUseColorEstimator = true; |
31 | 31 |
32 class RasterTaskImpl : public RasterTask { | 32 class RasterTaskImpl : public RasterTask { |
33 public: | 33 public: |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 result -= other; | 919 result -= other; |
920 return result; | 920 return result; |
921 } | 921 } |
922 | 922 |
923 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { | 923 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { |
924 return memory_bytes_ > limit.memory_bytes_ || | 924 return memory_bytes_ > limit.memory_bytes_ || |
925 resource_count_ > limit.resource_count_; | 925 resource_count_ > limit.resource_count_; |
926 } | 926 } |
927 | 927 |
928 } // namespace cc | 928 } // namespace cc |
OLD | NEW |