1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/tiles/tile_draw_info.h"
7 #include "base/metrics/histogram.h"
8 #include "cc/base/math_util.h"
12 TileDrawInfo::TileDrawInfo()
13 : mode_(RESOURCE_MODE
),
14 solid_color_(SK_ColorWHITE
),
16 contents_swizzled_(false),
17 was_ever_ready_to_draw_(false),
18 was_ever_used_to_draw_(false) {}
20 TileDrawInfo::~TileDrawInfo() {
22 if (was_ever_ready_to_draw_
) {
23 UMA_HISTOGRAM_BOOLEAN("Renderer4.ReadyToDrawTileDrawStatus",
24 was_ever_used_to_draw_
);
28 void TileDrawInfo::AsValueInto(base::trace_event::TracedValue
* state
) const {
29 state
->SetBoolean("is_solid_color", mode_
== SOLID_COLOR_MODE
);
30 state
->SetBoolean("is_transparent",
31 mode_
== SOLID_COLOR_MODE
&& !SkColorGetA(solid_color_
));