Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 bool needs_blending = false; | |
| 22 DrawQuad::SetAll(shared_quad_state, DrawQuad::SURFACE_CONTENT, rect, rect, | |
|
danakj
2014/01/14 18:31:57
Can you use temp vars to give these rects names, s
| |
| 23 rect, needs_blending); | |
| 24 this->surface_id = surface_id; | |
| 25 } | |
| 26 | |
| 27 | |
| 28 void SurfaceDrawQuad::SetAll(const SharedQuadState* shared_quad_state, | |
| 29 gfx::Rect rect, | |
| 30 gfx::Rect opaque_rect, | |
| 31 gfx::Rect visible_rect, | |
| 32 bool needs_blending, | |
| 33 int surface_id) { | |
| 34 DrawQuad::SetAll(shared_quad_state, DrawQuad::SURFACE_CONTENT, rect, | |
| 35 opaque_rect, visible_rect, needs_blending); | |
| 36 this->surface_id = surface_id; | |
| 37 } | |
| 38 | |
| 39 void SurfaceDrawQuad::IterateResources( | |
| 40 const ResourceIteratorCallback& callback) {} | |
| 41 | |
| 42 const SurfaceDrawQuad* SurfaceDrawQuad::MaterialCast(const DrawQuad* quad) { | |
| 43 DCHECK_EQ(quad->material, DrawQuad::SURFACE_CONTENT); | |
| 44 return static_cast<const SurfaceDrawQuad*>(quad); | |
| 45 } | |
| 46 | |
| 47 void SurfaceDrawQuad::ExtendValue(base::DictionaryValue* value) const { | |
| 48 value->SetInteger("surface_id", surface_id); | |
| 49 } | |
| 50 | |
| 51 | |
| 52 } // namespace cc | |
| OLD | NEW |