blob: 4fb6b4be3d74e3ec9c99a3e3d5a4628ebc4f3080 [file] [log] [blame]
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +01001// Copyright 2013 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.
4
5#ifndef CC_QUADS_PICTURE_DRAW_QUAD_H_
6#define CC_QUADS_PICTURE_DRAW_QUAD_H_
7
8#include "base/memory/ref_counted.h"
9#include "base/memory/scoped_ptr.h"
10#include "cc/base/cc_export.h"
11#include "cc/quads/content_draw_quad_base.h"
12#include "cc/resources/picture_pile_impl.h"
13#include "ui/gfx/rect.h"
14#include "ui/gfx/rect_f.h"
15#include "ui/gfx/size.h"
16
17namespace cc {
18
19// Used for on-demand tile rasterization.
20class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase {
21 public:
Ben Murdoch116680a2014-07-20 18:25:52 -070022 PictureDrawQuad();
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010023 virtual ~PictureDrawQuad();
24
25 void SetNew(const SharedQuadState* shared_quad_state,
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +000026 const gfx::Rect& rect,
27 const gfx::Rect& opaque_rect,
Torne (Richard Coles)a1401312014-03-18 10:20:56 +000028 const gfx::Rect& visible_rect,
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010029 const gfx::RectF& tex_coord_rect,
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +000030 const gfx::Size& texture_size,
Torne (Richard Coles)d0247b12013-09-19 22:36:51 +010031 ResourceFormat texture_format,
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +000032 const gfx::Rect& content_rect,
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010033 float contents_scale,
34 scoped_refptr<PicturePileImpl> picture_pile);
35
36 void SetAll(const SharedQuadState* shared_quad_state,
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +000037 const gfx::Rect& rect,
38 const gfx::Rect& opaque_rect,
39 const gfx::Rect& visible_rect,
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010040 bool needs_blending,
41 const gfx::RectF& tex_coord_rect,
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +000042 const gfx::Size& texture_size,
Torne (Richard Coles)d0247b12013-09-19 22:36:51 +010043 ResourceFormat texture_format,
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +000044 const gfx::Rect& content_rect,
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010045 float contents_scale,
46 scoped_refptr<PicturePileImpl> picture_pile);
47
48 gfx::Rect content_rect;
49 float contents_scale;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010050 scoped_refptr<PicturePileImpl> picture_pile;
Torne (Richard Coles)d0247b12013-09-19 22:36:51 +010051 ResourceFormat texture_format;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010052
53 virtual void IterateResources(const ResourceIteratorCallback& callback)
54 OVERRIDE;
55
56 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad);
57
58 private:
Torne (Richard Coles)5f1c9432014-08-12 13:47:38 +010059 virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010060};
61
62} // namespace cc
63
64#endif // CC_QUADS_PICTURE_DRAW_QUAD_H_