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"
11 DebugBorderDrawQuad::DebugBorderDrawQuad()
16 scoped_ptr
<DebugBorderDrawQuad
> DebugBorderDrawQuad::Create() {
17 return make_scoped_ptr(new DebugBorderDrawQuad
);
20 void DebugBorderDrawQuad::SetNew(const SharedQuadState
* shared_quad_state
,
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
);
33 void DebugBorderDrawQuad::SetAll(const SharedQuadState
* shared_quad_state
,
35 gfx::Rect opaque_rect
,
36 gfx::Rect visible_rect
,
40 DrawQuad::SetAll(shared_quad_state
, DrawQuad::DEBUG_BORDER
, rect
, opaque_rect
,
41 visible_rect
, needs_blending
);
46 void DebugBorderDrawQuad::IterateResources(
47 const ResourceIteratorCallback
& callback
) {}
49 const DebugBorderDrawQuad
* DebugBorderDrawQuad::MaterialCast(
50 const DrawQuad
* quad
) {
51 DCHECK(quad
->material
== DrawQuad::DEBUG_BORDER
);
52 return static_cast<const DebugBorderDrawQuad
*>(quad
);