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/quads/debug_border_draw_quad.h"
7 #include "base/logging.h"
8 #include "base/trace_event/trace_event_argument.h"
9 #include "base/values.h"
13 DebugBorderDrawQuad::DebugBorderDrawQuad()
18 void DebugBorderDrawQuad::SetNew(const SharedQuadState
* shared_quad_state
,
19 const gfx::Rect
& rect
,
20 const gfx::Rect
& visible_rect
,
23 gfx::Rect opaque_rect
;
24 bool needs_blending
= SkColorGetA(color
) < 255;
25 DrawQuad::SetAll(shared_quad_state
, DrawQuad::DEBUG_BORDER
, rect
, opaque_rect
,
26 visible_rect
, needs_blending
);
31 void DebugBorderDrawQuad::SetAll(const SharedQuadState
* shared_quad_state
,
32 const gfx::Rect
& rect
,
33 const gfx::Rect
& opaque_rect
,
34 const gfx::Rect
& visible_rect
,
38 DrawQuad::SetAll(shared_quad_state
, DrawQuad::DEBUG_BORDER
, rect
, opaque_rect
,
39 visible_rect
, needs_blending
);
44 const DebugBorderDrawQuad
* DebugBorderDrawQuad::MaterialCast(
45 const DrawQuad
* quad
) {
46 DCHECK(quad
->material
== DrawQuad::DEBUG_BORDER
);
47 return static_cast<const DebugBorderDrawQuad
*>(quad
);
50 void DebugBorderDrawQuad::ExtendValue(
51 base::trace_event::TracedValue
* value
) const {
52 value
->SetInteger("color", color
);
53 value
->SetInteger("width", width
);