Disable StorageInfoProviderTest.* on Valgrind bots.
[chromium-blink-merge.git] / cc / debug_border_draw_quad.cc
blobfba8b929d1d79f6863b931c1eaedee026c0afbd2
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
3 // found in the LICENSE file.
5 #include "cc/debug_border_draw_quad.h"
7 #include "base/logging.h"
9 namespace cc {
11 DebugBorderDrawQuad::DebugBorderDrawQuad()
12 : color(0),
13 width(0) {
16 scoped_ptr<DebugBorderDrawQuad> DebugBorderDrawQuad::Create() {
17 return make_scoped_ptr(new DebugBorderDrawQuad);
20 void DebugBorderDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
21 gfx::Rect rect,
22 SkColor color,
23 int width) {
24 gfx::Rect opaque_rect;
25 gfx::Rect visible_rect = rect;
26 bool needs_blending = SkColorGetA(color) < 255;
27 DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect,
28 visible_rect, needs_blending);
29 this->color = color;
30 this->width = width;
33 void DebugBorderDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
34 gfx::Rect rect,
35 gfx::Rect opaque_rect,
36 gfx::Rect visible_rect,
37 bool needs_blending,
38 SkColor color,
39 int width) {
40 DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect,
41 visible_rect, needs_blending);
42 this->color = color;
43 this->width = width;
46 const DebugBorderDrawQuad* DebugBorderDrawQuad::MaterialCast(
47 const DrawQuad* quad) {
48 DCHECK(quad->material == DrawQuad::DEBUG_BORDER);
49 return static_cast<const DebugBorderDrawQuad*>(quad);
52 } // namespace cc