blob: 510440745219506e9d477ffdb4409016fc6015c3 [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]89e82672013-03-18 07:50:565#ifndef CC_QUADS_TEXTURE_DRAW_QUAD_H_
6#define CC_QUADS_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]681ccff2013-03-18 06:13:529#include "cc/base/cc_export.h"
[email protected]89e82672013-03-18 07:50:5610#include "cc/quads/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,
[email protected]0023fc72014-01-10 20:05:0620 const gfx::Rect& rect,
21 const gfx::Rect& opaque_rect,
[email protected]c22418b2012-11-20 23:06:2622 unsigned resource_id,
23 bool premultiplied_alpha,
[email protected]1fd555b2013-01-18 00:13:2124 gfx::PointF uv_top_left,
25 gfx::PointF uv_bottom_right,
[email protected]d18b4d62013-07-12 05:33:4926 SkColor background_color,
[email protected]4c91aec2012-12-15 20:17:1827 const float vertex_opacity[4],
[email protected]c22418b2012-11-20 23:06:2628 bool flipped);
[email protected]cd57cc5a2012-10-12 22:43:4129
[email protected]c22418b2012-11-20 23:06:2630 void SetAll(const SharedQuadState* shared_quad_state,
[email protected]0023fc72014-01-10 20:05:0631 const gfx::Rect& rect,
32 const gfx::Rect& opaque_rect,
33 const gfx::Rect& visible_rect,
[email protected]c22418b2012-11-20 23:06:2634 bool needs_blending,
35 unsigned resource_id,
36 bool premultiplied_alpha,
[email protected]1fd555b2013-01-18 00:13:2137 gfx::PointF uv_top_left,
38 gfx::PointF uv_bottom_right,
[email protected]d18b4d62013-07-12 05:33:4939 SkColor background_color,
[email protected]4c91aec2012-12-15 20:17:1840 const float vertex_opacity[4],
[email protected]c22418b2012-11-20 23:06:2641 bool flipped);
[email protected]cd57cc5a2012-10-12 22:43:4142
[email protected]c22418b2012-11-20 23:06:2643 unsigned resource_id;
44 bool premultiplied_alpha;
[email protected]1fd555b2013-01-18 00:13:2145 gfx::PointF uv_top_left;
46 gfx::PointF uv_bottom_right;
[email protected]d18b4d62013-07-12 05:33:4947 SkColor background_color;
[email protected]4c91aec2012-12-15 20:17:1848 float vertex_opacity[4];
[email protected]c22418b2012-11-20 23:06:2649 bool flipped;
50
[email protected]3c0a63c22013-03-01 03:56:5851 virtual void IterateResources(const ResourceIteratorCallback& callback)
[email protected]05469632013-01-16 03:41:0052 OVERRIDE;
53
[email protected]c22418b2012-11-20 23:06:2654 static const TextureDrawQuad* MaterialCast(const DrawQuad*);
[email protected]cd48d682012-12-13 02:42:1955
[email protected]c22418b2012-11-20 23:06:2656 private:
57 TextureDrawQuad();
[email protected]34806722013-08-09 23:51:2158 virtual void ExtendValue(base::DictionaryValue* value) const OVERRIDE;
[email protected]cd57cc5a2012-10-12 22:43:4159};
60
[email protected]adb08542013-03-26 18:06:1061} // namespace cc
[email protected]cd57cc5a2012-10-12 22:43:4162
[email protected]89e82672013-03-18 07:50:5663#endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_