Fix a type mismatch on Windows caused by r201738.
[chromium-blink-merge.git] / cc / quads / debug_border_draw_quad.cc
blob1ebc0a6bdc2fd39ab36faec36bfd14ea06ad9580
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"
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 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);
55 } // namespace cc