Roll src/third_party/WebKit 095aee4:2f230fd (svn 197498:197508)
[chromium-blink-merge.git] / cc / tiles / tile_draw_info.cc
blob1713703c51be5bc7656d8baf2fb427a96c44a7c7
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 "cc/base/math_util.h"
9 namespace cc {
11 TileDrawInfo::TileDrawInfo()
12 : mode_(RESOURCE_MODE),
13 solid_color_(SK_ColorWHITE),
14 contents_swizzled_(false) {
17 TileDrawInfo::~TileDrawInfo() {
18 DCHECK(!resource_);
21 void TileDrawInfo::AsValueInto(base::trace_event::TracedValue* state) const {
22 state->SetBoolean("is_solid_color", mode_ == SOLID_COLOR_MODE);
23 state->SetBoolean("is_transparent",
24 mode_ == SOLID_COLOR_MODE && !SkColorGetA(solid_color_));
27 } // namespace cc