Implement multiple alternative services per origin.
[chromium-blink-merge.git] / cc / tiles / tile_draw_info.cc
blob6b12e73f5c669276d162456762bf175e36fce5b4
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"
10 namespace cc {
12 TileDrawInfo::TileDrawInfo()
13 : mode_(RESOURCE_MODE),
14 solid_color_(SK_ColorWHITE),
15 contents_swizzled_(false),
16 was_ever_ready_to_draw_(false),
17 was_ever_used_to_draw_(false) {
20 TileDrawInfo::~TileDrawInfo() {
21 DCHECK(!resource_);
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_));
34 } // namespace cc