blob: 6ec2934790b23e3e3f2a33563da38b5b26278639 [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
[email protected]8fcbaa372012-11-05 04:12:415#ifndef CC_TEXTURE_DRAW_QUAD_H_
6#define CC_TEXTURE_DRAW_QUAD_H_
[email protected]cd57cc5a2012-10-12 22:43:417
[email protected]cd57cc5a2012-10-12 22:43:418#include "base/memory/scoped_ptr.h"
[email protected]52347c842012-11-02 21:06:209#include "cc/cc_export.h"
[email protected]aa0a9d32012-10-24 01:58:1010#include "cc/draw_quad.h"
[email protected]1fea8142012-10-20 04:12:4111#include "ui/gfx/rect_f.h"
[email protected]cd57cc5a2012-10-12 22:43:4112
13namespace cc {
14
[email protected]52347c842012-11-02 21:06:2015class CC_EXPORT TextureDrawQuad : public DrawQuad {
[email protected]c22418b2012-11-20 23:06:2616 public:
17 static scoped_ptr<TextureDrawQuad> Create();
[email protected]cd57cc5a2012-10-12 22:43:4118
[email protected]c22418b2012-11-20 23:06:2619 void SetNew(const SharedQuadState* shared_quad_state,
20 gfx::Rect rect,
21 gfx::Rect opaque_rect,
22 unsigned resource_id,
23 bool premultiplied_alpha,
24 const gfx::RectF& uv_rect,
[email protected]4c91aec2012-12-15 20:17:1825 const float vertex_opacity[4],
[email protected]c22418b2012-11-20 23:06:2626 bool flipped);
[email protected]cd57cc5a2012-10-12 22:43:4127
[email protected]c22418b2012-11-20 23:06:2628 void SetAll(const SharedQuadState* shared_quad_state,
29 gfx::Rect rect,
30 gfx::Rect opaque_rect,
31 gfx::Rect visible_rect,
32 bool needs_blending,
33 unsigned resource_id,
34 bool premultiplied_alpha,
35 const gfx::RectF& uv_rect,
[email protected]4c91aec2012-12-15 20:17:1836 const float vertex_opacity[4],
[email protected]c22418b2012-11-20 23:06:2637 bool flipped);
[email protected]cd57cc5a2012-10-12 22:43:4138
[email protected]c22418b2012-11-20 23:06:2639 unsigned resource_id;
40 bool premultiplied_alpha;
41 gfx::RectF uv_rect;
[email protected]4c91aec2012-12-15 20:17:1842 float vertex_opacity[4];
[email protected]c22418b2012-11-20 23:06:2643 bool flipped;
44
[email protected]05469632013-01-16 03:41:0045 virtual void AppendResources(ResourceProvider::ResourceIdArray* resources)
46 OVERRIDE;
47
[email protected]c22418b2012-11-20 23:06:2648 static const TextureDrawQuad* MaterialCast(const DrawQuad*);
[email protected]cd48d682012-12-13 02:42:1949
50 bool PerformClipping();
[email protected]c22418b2012-11-20 23:06:2651 private:
52 TextureDrawQuad();
[email protected]cd57cc5a2012-10-12 22:43:4153};
54
[email protected]cd57cc5a2012-10-12 22:43:4155}
56
[email protected]8fcbaa372012-11-05 04:12:4157#endif // CC_TEXTURE_DRAW_QUAD_H_