Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Side by Side Diff: cc/quads/stream_video_draw_quad.h

Issue 2683763003: cc: make resource keep video buffer format for hardware overlay.
Patch Set: plumbing video format to ozone Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ 5 #ifndef CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_
6 #define CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ 6 #define CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
13 #include "cc/quads/draw_quad.h" 13 #include "cc/quads/draw_quad.h"
14 #include "ui/gfx/buffer_types.h"
14 #include "ui/gfx/transform.h" 15 #include "ui/gfx/transform.h"
15 16
16 namespace cc { 17 namespace cc {
17 18
18 class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { 19 class CC_EXPORT StreamVideoDrawQuad : public DrawQuad {
19 public: 20 public:
20 static const size_t kResourceIdIndex = 0; 21 static const size_t kResourceIdIndex = 0;
21 22
22 StreamVideoDrawQuad(); 23 StreamVideoDrawQuad();
23 24
24 void SetNew(const SharedQuadState* shared_quad_state, 25 void SetNew(const SharedQuadState* shared_quad_state,
25 const gfx::Rect& rect, 26 const gfx::Rect& rect,
26 const gfx::Rect& opaque_rect, 27 const gfx::Rect& opaque_rect,
27 const gfx::Rect& visible_rect, 28 const gfx::Rect& visible_rect,
28 unsigned resource_id, 29 unsigned resource_id,
29 gfx::Size resource_size_in_pixels, 30 gfx::Size resource_size_in_pixels,
31 gfx::BufferFormat format,
30 const gfx::Transform& matrix); 32 const gfx::Transform& matrix);
31 33
32 void SetAll(const SharedQuadState* shared_quad_state, 34 void SetAll(const SharedQuadState* shared_quad_state,
33 const gfx::Rect& rect, 35 const gfx::Rect& rect,
34 const gfx::Rect& opaque_rect, 36 const gfx::Rect& opaque_rect,
35 const gfx::Rect& visible_rect, 37 const gfx::Rect& visible_rect,
36 bool needs_blending, 38 bool needs_blending,
37 unsigned resource_id, 39 unsigned resource_id,
38 gfx::Size resource_size_in_pixels, 40 gfx::Size resource_size_in_pixels,
41 gfx::BufferFormat format,
39 const gfx::Transform& matrix); 42 const gfx::Transform& matrix);
40 43
44 gfx::BufferFormat format = gfx::BufferFormat::RGBA_8888;
41 gfx::Transform matrix; 45 gfx::Transform matrix;
42 46
43 struct OverlayResources { 47 struct OverlayResources {
44 OverlayResources(); 48 OverlayResources();
45 gfx::Size size_in_pixels[Resources::kMaxResourceIdCount]; 49 gfx::Size size_in_pixels[Resources::kMaxResourceIdCount];
46 }; 50 };
47 OverlayResources overlay_resources; 51 OverlayResources overlay_resources;
48 52
49 static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*); 53 static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*);
50 54
51 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } 55 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; }
52 const gfx::Size& resource_size_in_pixels() const { 56 const gfx::Size& resource_size_in_pixels() const {
53 return overlay_resources.size_in_pixels[kResourceIdIndex]; 57 return overlay_resources.size_in_pixels[kResourceIdIndex];
54 } 58 }
55 59
56 private: 60 private:
57 void ExtendValue(base::trace_event::TracedValue* value) const override; 61 void ExtendValue(base::trace_event::TracedValue* value) const override;
58 }; 62 };
59 63
60 } // namespace cc 64 } // namespace cc
61 65
62 #endif // CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ 66 #endif // CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698