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

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

Issue 2064833002: Implement DrawQuad StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix move constructor Created 4 years, 6 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
« no previous file with comments | « cc/quads/render_pass_draw_quad.h ('k') | cc/quads/tile_draw_quad.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_TEXTURE_DRAW_QUAD_H_ 5 #ifndef CC_QUADS_TEXTURE_DRAW_QUAD_H_
6 #define CC_QUADS_TEXTURE_DRAW_QUAD_H_ 6 #define CC_QUADS_TEXTURE_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/geometry/rect_f.h" 14 #include "ui/gfx/geometry/rect_f.h"
15 15
16 namespace cc { 16 namespace cc {
17 17
18 class CC_EXPORT TextureDrawQuad : public DrawQuad { 18 class CC_EXPORT TextureDrawQuad : public DrawQuad {
19 public: 19 public:
20 static const size_t kResourceIdIndex = 0;
21
20 TextureDrawQuad(); 22 TextureDrawQuad();
21 TextureDrawQuad(const TextureDrawQuad& other); 23 TextureDrawQuad(const TextureDrawQuad& other);
22 24
23 void SetNew(const SharedQuadState* shared_quad_state, 25 void SetNew(const SharedQuadState* shared_quad_state,
24 const gfx::Rect& rect, 26 const gfx::Rect& rect,
25 const gfx::Rect& opaque_rect, 27 const gfx::Rect& opaque_rect,
26 const gfx::Rect& visible_rect, 28 const gfx::Rect& visible_rect,
27 unsigned resource_id, 29 unsigned resource_id,
28 bool premultiplied_alpha, 30 bool premultiplied_alpha,
29 const gfx::PointF& uv_top_left, 31 const gfx::PointF& uv_top_left,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const gfx::Size& resource_size_in_pixels() const { 72 const gfx::Size& resource_size_in_pixels() const {
71 return overlay_resources.size_in_pixels[kResourceIdIndex]; 73 return overlay_resources.size_in_pixels[kResourceIdIndex];
72 } 74 }
73 void set_resource_size_in_pixels(const gfx::Size& size_in_pixels) { 75 void set_resource_size_in_pixels(const gfx::Size& size_in_pixels) {
74 overlay_resources.size_in_pixels[kResourceIdIndex] = size_in_pixels; 76 overlay_resources.size_in_pixels[kResourceIdIndex] = size_in_pixels;
75 } 77 }
76 78
77 static const TextureDrawQuad* MaterialCast(const DrawQuad*); 79 static const TextureDrawQuad* MaterialCast(const DrawQuad*);
78 80
79 private: 81 private:
80 static const size_t kResourceIdIndex = 0;
81
82 void ExtendValue(base::trace_event::TracedValue* value) const override; 82 void ExtendValue(base::trace_event::TracedValue* value) const override;
83 }; 83 };
84 84
85 } // namespace cc 85 } // namespace cc
86 86
87 #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_ 87 #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_
OLDNEW
« no previous file with comments | « cc/quads/render_pass_draw_quad.h ('k') | cc/quads/tile_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698