ProfilePolicyConnectorFactory: Refactoring from Profile to BrowserContext.
[chromium-blink-merge.git] / cc / quads / checkerboard_draw_quad.cc
blob2d8957d722138c8f6b0d9e59c24832c689d7f27a
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/checkerboard_draw_quad.h"
7 #include "base/logging.h"
8 #include "base/trace_event/trace_event_argument.h"
9 #include "base/values.h"
11 namespace cc {
13 CheckerboardDrawQuad::CheckerboardDrawQuad() : color(0) {}
15 void CheckerboardDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
16 const gfx::Rect& rect,
17 const gfx::Rect& visible_rect,
18 SkColor color) {
19 gfx::Rect opaque_rect = SkColorGetA(color) == 255 ? rect : gfx::Rect();
20 bool needs_blending = false;
21 DrawQuad::SetAll(shared_quad_state, DrawQuad::CHECKERBOARD, rect, opaque_rect,
22 visible_rect, needs_blending);
23 this->color = color;
26 void CheckerboardDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
27 const gfx::Rect& rect,
28 const gfx::Rect& opaque_rect,
29 const gfx::Rect& visible_rect,
30 bool needs_blending,
31 SkColor color) {
32 DrawQuad::SetAll(shared_quad_state, DrawQuad::CHECKERBOARD, rect, opaque_rect,
33 visible_rect, needs_blending);
34 this->color = color;
37 void CheckerboardDrawQuad::IterateResources(
38 const ResourceIteratorCallback& callback) {}
40 const CheckerboardDrawQuad* CheckerboardDrawQuad::MaterialCast(
41 const DrawQuad* quad) {
42 DCHECK(quad->material == DrawQuad::CHECKERBOARD);
43 return static_cast<const CheckerboardDrawQuad*>(quad);
46 void CheckerboardDrawQuad::ExtendValue(
47 base::trace_event::TracedValue* value) const {
48 value->SetInteger("color", color);
51 } // namespace cc