Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: cc/quads/checkerboard_draw_quad.cc

Issue 1271843005: cc: Remove code for drawing checkerboard quads, it's not used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm-checkers: sizes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/quads/checkerboard_draw_quad.h ('k') | cc/quads/draw_quad.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "cc/quads/checkerboard_draw_quad.h"
6
7 #include "base/logging.h"
8 #include "base/trace_event/trace_event_argument.h"
9 #include "base/values.h"
10
11 namespace cc {
12
13 CheckerboardDrawQuad::CheckerboardDrawQuad() : color(0), scale(0.f) {
14 }
15
16 void CheckerboardDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
17 const gfx::Rect& rect,
18 const gfx::Rect& visible_rect,
19 SkColor color,
20 float scale) {
21 gfx::Rect opaque_rect = SkColorGetA(color) == 255 ? rect : gfx::Rect();
22 bool needs_blending = false;
23 DrawQuad::SetAll(shared_quad_state, DrawQuad::CHECKERBOARD, rect, opaque_rect,
24 visible_rect, needs_blending);
25 this->color = color;
26 this->scale = scale;
27 }
28
29 void CheckerboardDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
30 const gfx::Rect& rect,
31 const gfx::Rect& opaque_rect,
32 const gfx::Rect& visible_rect,
33 bool needs_blending,
34 SkColor color,
35 float scale) {
36 DrawQuad::SetAll(shared_quad_state, DrawQuad::CHECKERBOARD, rect, opaque_rect,
37 visible_rect, needs_blending);
38 this->color = color;
39 this->scale = scale;
40 }
41
42 const CheckerboardDrawQuad* CheckerboardDrawQuad::MaterialCast(
43 const DrawQuad* quad) {
44 DCHECK(quad->material == DrawQuad::CHECKERBOARD);
45 return static_cast<const CheckerboardDrawQuad*>(quad);
46 }
47
48 void CheckerboardDrawQuad::ExtendValue(
49 base::trace_event::TracedValue* value) const {
50 value->SetInteger("color", color);
51 value->SetDouble("scale", scale);
52 }
53
54 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/checkerboard_draw_quad.h ('k') | cc/quads/draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698