blob: 08d075fe1a7054e352136747702cf91af1e121cc [file] [log] [blame]
[email protected]0fb25002012-10-12 07:20:021// Copyright 2012 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.
[email protected]cd57cc5a2012-10-12 22:43:414
5#ifndef CCTileDrawQuad_h
6#define CCTileDrawQuad_h
7
8#include "CCDrawQuad.h"
[email protected]d9c28522012-10-18 23:35:439#include "third_party/khronos/GLES2/gl2.h"
[email protected]cd57cc5a2012-10-12 22:43:4110#include "base/memory/scoped_ptr.h"
[email protected]1fea8142012-10-20 04:12:4111#include "ui/gfx/point.h"
12#include "ui/gfx/size.h"
[email protected]cd57cc5a2012-10-12 22:43:4113
14namespace cc {
15
16#pragma pack(push, 4)
17
[email protected]c753e25a2012-10-19 21:22:4218class CCTileDrawQuad : public CCDrawQuad {
[email protected]cd57cc5a2012-10-12 22:43:4119public:
[email protected]1fea8142012-10-20 04:12:4120 static scoped_ptr<CCTileDrawQuad> create(const CCSharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Point& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA);
[email protected]cd57cc5a2012-10-12 22:43:4121
22 unsigned resourceId() const { return m_resourceId; }
[email protected]1fea8142012-10-20 04:12:4123 gfx::Point textureOffset() const { return m_textureOffset; }
24 gfx::Size textureSize() const { return m_textureSize; }
[email protected]d9c28522012-10-18 23:35:4325 GLint textureFilter() const { return m_textureFilter; }
[email protected]cd57cc5a2012-10-12 22:43:4126 bool swizzleContents() const { return m_swizzleContents; }
27
28 bool leftEdgeAA() const { return m_leftEdgeAA; }
29 bool topEdgeAA() const { return m_topEdgeAA; }
30 bool rightEdgeAA() const { return m_rightEdgeAA; }
31 bool bottomEdgeAA() const { return m_bottomEdgeAA; }
32
33 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdgeAA() || bottomEdgeAA(); }
34
[email protected]c753e25a2012-10-19 21:22:4235 static const CCTileDrawQuad* materialCast(const CCDrawQuad*);
[email protected]cd57cc5a2012-10-12 22:43:4136private:
[email protected]1fea8142012-10-20 04:12:4137 CCTileDrawQuad(const CCSharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Point& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA);
[email protected]cd57cc5a2012-10-12 22:43:4138
39 unsigned m_resourceId;
[email protected]1fea8142012-10-20 04:12:4140 gfx::Point m_textureOffset;
41 gfx::Size m_textureSize;
[email protected]d9c28522012-10-18 23:35:4342 GLint m_textureFilter;
[email protected]cd57cc5a2012-10-12 22:43:4143 bool m_swizzleContents;
44 bool m_leftEdgeAA;
45 bool m_topEdgeAA;
46 bool m_rightEdgeAA;
47 bool m_bottomEdgeAA;
48};
49
50#pragma pack(pop)
51
52}
53
54#endif