| 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) | 18 : DrawQuad(sharedQuadState, DrawQuad::TILED_CONTENT, quadRect, opaqueRect) |
| 19 , m_resourceId(resourceId) | 19 , m_resourceId(resourceId) |
| 20 , m_textureOffset(textureOffset) | 20 , m_textureOffset(textureOffset) |
| 21 , m_textureSize(textureSize) | 21 , m_textureSize(textureSize) |
| 22 , m_swizzleContents(swizzleContents) | 22 , m_swizzleContents(swizzleContents) |
| 23 , m_leftEdgeAA(leftEdgeAA) | 23 , m_leftEdgeAA(leftEdgeAA) |
| 24 , m_topEdgeAA(topEdgeAA) | 24 , m_topEdgeAA(topEdgeAA) |
| 25 , m_rightEdgeAA(rightEdgeAA) | 25 , m_rightEdgeAA(rightEdgeAA) |
| 26 , m_bottomEdgeAA(bottomEdgeAA) | 26 , m_bottomEdgeAA(bottomEdgeAA) |
| 27 { | 27 { |
| 28 if (isAntialiased()) | 28 if (isAntialiased()) |
| 29 m_needsBlending = true; | 29 m_needsBlending = true; |
| 30 m_opaqueRect = opaqueRect; | |
| 31 } | 30 } |
| 32 | 31 |
| 33 const TileDrawQuad* TileDrawQuad::materialCast(const DrawQuad* quad) | 32 const TileDrawQuad* TileDrawQuad::materialCast(const DrawQuad* quad) |
| 34 { | 33 { |
| 35 DCHECK(quad->material() == DrawQuad::TILED_CONTENT); | 34 DCHECK(quad->material() == DrawQuad::TILED_CONTENT); |
| 36 return static_cast<const TileDrawQuad*>(quad); | 35 return static_cast<const TileDrawQuad*>(quad); |
| 37 } | 36 } |
| 38 | 37 |
| 39 } // namespace cc | 38 } // namespace cc |
| OLD | NEW |