| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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/tile_draw_quad.h" | 5 #include "cc/tile_draw_quad.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/khronos/GLES2/gl2.h" | 8 #include "third_party/khronos/GLES2/gl2.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 scoped_ptr<TileDrawQuad> TileDrawQuad::create(const SharedQuadState* sharedQuadS
tate, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceI
d, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzl
eContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) | 12 scoped_ptr<TileDrawQuad> TileDrawQuad::create(const SharedQuadState* sharedQuadS
tate, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceI
d, const gfx::Vector2d& textureOffset, const gfx::Size& textureSize, bool swizzl
eContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) |
| 13 { | 13 { |
| 14 return make_scoped_ptr(new TileDrawQuad(sharedQuadState, quadRect, opaqueRec
t, resourceId, textureOffset, textureSize, swizzleContents, leftEdgeAA, topEdgeA
A, rightEdgeAA, bottomEdgeAA)); | 14 return make_scoped_ptr(new TileDrawQuad(sharedQuadState, quadRect, opaqueRec
t, resourceId, textureOffset, textureSize, swizzleContents, leftEdgeAA, topEdgeA
A, rightEdgeAA, bottomEdgeAA)); |
| 15 } | 15 } |
| 16 | 16 |
| 17 TileDrawQuad::TileDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Re
ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vecto
r2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool lef
tEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) | 17 TileDrawQuad::TileDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Re
ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vecto
r2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool lef
tEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA) |
| 18 : DrawQuad(sharedQuadState, DrawQuad::TILED_CONTENT, quadRect, opaqueRect) | 18 : m_resourceId(resourceId) |
| 19 , m_resourceId(resourceId) | |
| 20 , m_textureOffset(textureOffset) | 19 , m_textureOffset(textureOffset) |
| 21 , m_textureSize(textureSize) | 20 , m_textureSize(textureSize) |
| 22 , m_swizzleContents(swizzleContents) | 21 , m_swizzleContents(swizzleContents) |
| 23 , m_leftEdgeAA(leftEdgeAA) | 22 , m_leftEdgeAA(leftEdgeAA) |
| 24 , m_topEdgeAA(topEdgeAA) | 23 , m_topEdgeAA(topEdgeAA) |
| 25 , m_rightEdgeAA(rightEdgeAA) | 24 , m_rightEdgeAA(rightEdgeAA) |
| 26 , m_bottomEdgeAA(bottomEdgeAA) | 25 , m_bottomEdgeAA(bottomEdgeAA) |
| 27 { | 26 { |
| 28 if (isAntialiased()) | 27 gfx::Rect visibleRect = quadRect; |
| 29 needs_blending_ = true; | 28 bool needsBlending = isAntialiased(); |
| 29 DrawQuad::SetAll(sharedQuadState, DrawQuad::TILED_CONTENT, quadRect, opaqueR
ect, visibleRect, needsBlending); |
| 30 } | 30 } |
| 31 | 31 |
| 32 const TileDrawQuad* TileDrawQuad::materialCast(const DrawQuad* quad) | 32 const TileDrawQuad* TileDrawQuad::materialCast(const DrawQuad* quad) |
| 33 { | 33 { |
| 34 DCHECK(quad->material() == DrawQuad::TILED_CONTENT); | 34 DCHECK(quad->material == DrawQuad::TILED_CONTENT); |
| 35 return static_cast<const TileDrawQuad*>(quad); | 35 return static_cast<const TileDrawQuad*>(quad); |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace cc | 38 } // namespace cc |
| OLD | NEW |