| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/quads/content_draw_quad_base.h" | 5 #include "cc/quads/content_draw_quad_base.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event_argument.h" | 7 #include "base/debug/trace_event_argument.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 ContentDrawQuadBase::ContentDrawQuadBase() | 14 ContentDrawQuadBase::ContentDrawQuadBase() |
| 15 : swizzle_contents(false) { | 15 : swizzle_contents(false) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 ContentDrawQuadBase::~ContentDrawQuadBase() { | 18 ContentDrawQuadBase::~ContentDrawQuadBase() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 void ContentDrawQuadBase::SetNew(const SharedQuadState* shared_quad_state, | 21 void ContentDrawQuadBase::SetNew(const SharedQuadState* shared_quad_state, |
| 22 DrawQuad::Material material, | 22 DrawQuad::Material material, |
| 23 const gfx::Rect& rect, | 23 const gfx::Rect& rect, |
| 24 const gfx::Rect& opaque_rect, | 24 const gfx::Rect& opaque_rect, |
| 25 const gfx::Rect& visible_rect, | 25 const gfx::Rect& visible_rect, |
| 26 const gfx::RectF& tex_coord_rect, | 26 const gfx::RectF& tex_coord_rect, |
| 27 const gfx::Size& texture_size, | 27 const gfx::Size& texture_size, |
| 28 bool swizzle_contents) { | 28 bool swizzle_contents, |
| 29 bool nearest_neighbor) { |
| 29 bool needs_blending = false; | 30 bool needs_blending = false; |
| 30 DrawQuad::SetAll(shared_quad_state, material, rect, opaque_rect, | 31 DrawQuad::SetAll(shared_quad_state, material, rect, opaque_rect, |
| 31 visible_rect, needs_blending); | 32 visible_rect, needs_blending); |
| 32 this->tex_coord_rect = tex_coord_rect; | 33 this->tex_coord_rect = tex_coord_rect; |
| 33 this->texture_size = texture_size; | 34 this->texture_size = texture_size; |
| 34 this->swizzle_contents = swizzle_contents; | 35 this->swizzle_contents = swizzle_contents; |
| 36 this->nearest_neighbor = nearest_neighbor; |
| 35 } | 37 } |
| 36 | 38 |
| 37 void ContentDrawQuadBase::SetAll(const SharedQuadState* shared_quad_state, | 39 void ContentDrawQuadBase::SetAll(const SharedQuadState* shared_quad_state, |
| 38 DrawQuad::Material material, | 40 DrawQuad::Material material, |
| 39 const gfx::Rect& rect, | 41 const gfx::Rect& rect, |
| 40 const gfx::Rect& opaque_rect, | 42 const gfx::Rect& opaque_rect, |
| 41 const gfx::Rect& visible_rect, | 43 const gfx::Rect& visible_rect, |
| 42 bool needs_blending, | 44 bool needs_blending, |
| 43 const gfx::RectF& tex_coord_rect, | 45 const gfx::RectF& tex_coord_rect, |
| 44 const gfx::Size& texture_size, | 46 const gfx::Size& texture_size, |
| 45 bool swizzle_contents) { | 47 bool swizzle_contents, |
| 48 bool nearest_neighbor) { |
| 46 DrawQuad::SetAll(shared_quad_state, material, rect, opaque_rect, | 49 DrawQuad::SetAll(shared_quad_state, material, rect, opaque_rect, |
| 47 visible_rect, needs_blending); | 50 visible_rect, needs_blending); |
| 48 this->tex_coord_rect = tex_coord_rect; | 51 this->tex_coord_rect = tex_coord_rect; |
| 49 this->texture_size = texture_size; | 52 this->texture_size = texture_size; |
| 50 this->swizzle_contents = swizzle_contents; | 53 this->swizzle_contents = swizzle_contents; |
| 54 this->nearest_neighbor = nearest_neighbor; |
| 51 } | 55 } |
| 52 | 56 |
| 53 void ContentDrawQuadBase::ExtendValue(base::debug::TracedValue* value) const { | 57 void ContentDrawQuadBase::ExtendValue(base::debug::TracedValue* value) const { |
| 54 value->BeginArray("tex_coord_rect"); | 58 value->BeginArray("tex_coord_rect"); |
| 55 MathUtil::AddToTracedValue(tex_coord_rect, value); | 59 MathUtil::AddToTracedValue(tex_coord_rect, value); |
| 56 value->EndArray(); | 60 value->EndArray(); |
| 57 | 61 |
| 58 value->BeginDictionary("texture_size"); | 62 value->BeginDictionary("texture_size"); |
| 59 MathUtil::AddToTracedValue(texture_size, value); | 63 MathUtil::AddToTracedValue(texture_size, value); |
| 60 value->EndDictionary(); | 64 value->EndDictionary(); |
| 61 | 65 |
| 62 value->SetBoolean("swizzle_contents", swizzle_contents); | 66 value->SetBoolean("swizzle_contents", swizzle_contents); |
| 67 value->SetBoolean("nearest_neighbor", nearest_neighbor); |
| 63 } | 68 } |
| 64 | 69 |
| 65 } // namespace cc | 70 } // namespace cc |
| OLD | NEW |