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/values.h"
12 DebugBorderDrawQuad::DebugBorderDrawQuad()
17 void DebugBorderDrawQuad::SetNew(const SharedQuadState
* shared_quad_state
,
18 const gfx::Rect
& rect
,
19 const gfx::Rect
& visible_rect
,
22 gfx::Rect opaque_rect
;
23 bool needs_blending
= SkColorGetA(color
) < 255;
24 DrawQuad::SetAll(shared_quad_state
, DrawQuad::DEBUG_BORDER
, rect
, opaque_rect
,
25 visible_rect
, needs_blending
);
30 void DebugBorderDrawQuad::SetAll(const SharedQuadState
* shared_quad_state
,
31 const gfx::Rect
& rect
,
32 const gfx::Rect
& opaque_rect
,
33 const gfx::Rect
& visible_rect
,
37 DrawQuad::SetAll(shared_quad_state
, DrawQuad::DEBUG_BORDER
, rect
, opaque_rect
,
38 visible_rect
, needs_blending
);
43 void DebugBorderDrawQuad::IterateResources(
44 const ResourceIteratorCallback
& callback
) {}
46 const DebugBorderDrawQuad
* DebugBorderDrawQuad::MaterialCast(
47 const DrawQuad
* quad
) {
48 DCHECK(quad
->material
== DrawQuad::DEBUG_BORDER
);
49 return static_cast<const DebugBorderDrawQuad
*>(quad
);
52 void DebugBorderDrawQuad::ExtendValue(base::DictionaryValue
* value
) const {
53 value
->SetInteger("color", color
);
54 value
->SetInteger("width", width
);