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

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

Issue 127373002: Add cc:DrawQuad type for surfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update cc_messages_unittests Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « cc/quads/surface_draw_quad.h ('k') | content/common/cc_messages.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 2014 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/surface_draw_quad.h"
6
7 #include "base/logging.h"
8 #include "base/values.h"
9
10 namespace cc {
11
12 SurfaceDrawQuad::SurfaceDrawQuad() : surface_id(0) {}
13
14 scoped_ptr<SurfaceDrawQuad> SurfaceDrawQuad::Create() {
15 return make_scoped_ptr(new SurfaceDrawQuad);
16 }
17
18 void SurfaceDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
19 gfx::Rect rect,
20 int surface_id) {
21 gfx::Rect opaque_rect;
22 gfx::Rect visible_rect = rect;
23 bool needs_blending = false;
24 DrawQuad::SetAll(shared_quad_state, DrawQuad::SURFACE_CONTENT, rect,
25 opaque_rect, visible_rect, needs_blending);
26 this->surface_id = surface_id;
27 }
28
29
30 void SurfaceDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
31 gfx::Rect rect,
32 gfx::Rect opaque_rect,
33 gfx::Rect visible_rect,
34 bool needs_blending,
35 int surface_id) {
36 DrawQuad::SetAll(shared_quad_state, DrawQuad::SURFACE_CONTENT, rect,
37 opaque_rect, visible_rect, needs_blending);
38 this->surface_id = surface_id;
39 }
40
41 void SurfaceDrawQuad::IterateResources(
42 const ResourceIteratorCallback& callback) {}
43
44 const SurfaceDrawQuad* SurfaceDrawQuad::MaterialCast(const DrawQuad* quad) {
45 DCHECK_EQ(quad->material, DrawQuad::SURFACE_CONTENT);
46 return static_cast<const SurfaceDrawQuad*>(quad);
47 }
48
49 void SurfaceDrawQuad::ExtendValue(base::DictionaryValue* value) const {
50 value->SetInteger("surface_id", surface_id);
51 }
52
53
54 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/surface_draw_quad.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698