summaryrefslogtreecommitdiffstats
path: root/cc/CCTextureDrawQuad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cc/CCTextureDrawQuad.cpp')
-rw-r--r--cc/CCTextureDrawQuad.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/cc/CCTextureDrawQuad.cpp b/cc/CCTextureDrawQuad.cpp
new file mode 100644
index 0000000..4451ad2
--- /dev/null
+++ b/cc/CCTextureDrawQuad.cpp
@@ -0,0 +1,36 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+
+#include "CCTextureDrawQuad.h"
+
+namespace WebCore {
+
+PassOwnPtr<CCTextureDrawQuad> CCTextureDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, unsigned resourceId, bool premultipliedAlpha, const FloatRect& uvRect, bool flipped)
+{
+ return adoptPtr(new CCTextureDrawQuad(sharedQuadState, quadRect, resourceId, premultipliedAlpha, uvRect, flipped));
+}
+
+CCTextureDrawQuad::CCTextureDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, unsigned resourceId, bool premultipliedAlpha, const FloatRect& uvRect, bool flipped)
+ : CCDrawQuad(sharedQuadState, CCDrawQuad::TextureContent, quadRect)
+ , m_resourceId(resourceId)
+ , m_premultipliedAlpha(premultipliedAlpha)
+ , m_uvRect(uvRect)
+ , m_flipped(flipped)
+{
+}
+
+void CCTextureDrawQuad::setNeedsBlending()
+{
+ m_needsBlending = true;
+}
+
+const CCTextureDrawQuad* CCTextureDrawQuad::materialCast(const CCDrawQuad* quad)
+{
+ ASSERT(quad->material() == CCDrawQuad::TextureContent);
+ return static_cast<const CCTextureDrawQuad*>(quad);
+}
+
+}