Separate projection mode from rest of touch HUD
[chromium-blink-merge.git] / cc / quads / solid_color_draw_quad.cc
blob5575aaf127e7c6c765c47cd85080d28d990c9a05
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/solid_color_draw_quad.h"
7 #include "base/logging.h"
9 namespace cc {
11 SolidColorDrawQuad::SolidColorDrawQuad()
12 : color(0), force_anti_aliasing_off(false) {}
14 scoped_ptr<SolidColorDrawQuad> SolidColorDrawQuad::Create() {
15 return make_scoped_ptr(new SolidColorDrawQuad);
18 void SolidColorDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
19 gfx::Rect rect,
20 SkColor color,
21 bool force_anti_aliasing_off) {
22 gfx::Rect opaque_rect = SkColorGetA(color) == 255 ? rect : gfx::Rect();
23 gfx::Rect visible_rect = rect;
24 bool needs_blending = false;
25 DrawQuad::SetAll(shared_quad_state, DrawQuad::SOLID_COLOR, rect, opaque_rect,
26 visible_rect, needs_blending);
27 this->color = color;
28 this->force_anti_aliasing_off = force_anti_aliasing_off;
31 void SolidColorDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
32 gfx::Rect rect,
33 gfx::Rect opaque_rect,
34 gfx::Rect visible_rect,
35 bool needs_blending,
36 SkColor color,
37 bool force_anti_aliasing_off) {
38 DrawQuad::SetAll(shared_quad_state, DrawQuad::SOLID_COLOR, rect, opaque_rect,
39 visible_rect, needs_blending);
40 this->color = color;
41 this->force_anti_aliasing_off = force_anti_aliasing_off;
44 void SolidColorDrawQuad::IterateResources(
45 const ResourceIteratorCallback& callback) {}
47 const SolidColorDrawQuad* SolidColorDrawQuad::MaterialCast(
48 const DrawQuad* quad) {
49 DCHECK(quad->material == DrawQuad::SOLID_COLOR);
50 return static_cast<const SolidColorDrawQuad*>(quad);
53 } // namespacec cc