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

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

Issue 1142343008: cc: Rework overlays to not use the ResourceProvider and pass texture size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
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 "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 17 matching lines...) Expand all
28 const float vertex_opacity[4], 28 const float vertex_opacity[4],
29 bool y_flipped, 29 bool y_flipped,
30 bool nearest_neighbor); 30 bool nearest_neighbor);
31 31
32 void SetAll(const SharedQuadState* shared_quad_state, 32 void SetAll(const SharedQuadState* shared_quad_state,
33 const gfx::Rect& rect, 33 const gfx::Rect& rect,
34 const gfx::Rect& opaque_rect, 34 const gfx::Rect& opaque_rect,
35 const gfx::Rect& visible_rect, 35 const gfx::Rect& visible_rect,
36 bool needs_blending, 36 bool needs_blending,
37 unsigned resource_id, 37 unsigned resource_id,
38 gfx::Size resource_size_in_pixels,
39 bool allow_overlay,
38 bool premultiplied_alpha, 40 bool premultiplied_alpha,
39 const gfx::PointF& uv_top_left, 41 const gfx::PointF& uv_top_left,
40 const gfx::PointF& uv_bottom_right, 42 const gfx::PointF& uv_bottom_right,
41 SkColor background_color, 43 SkColor background_color,
42 const float vertex_opacity[4], 44 const float vertex_opacity[4],
43 bool y_flipped, 45 bool y_flipped,
44 bool nearest_neighbor); 46 bool nearest_neighbor);
45 47
46 bool premultiplied_alpha; 48 bool premultiplied_alpha;
47 gfx::PointF uv_top_left; 49 gfx::PointF uv_top_left;
48 gfx::PointF uv_bottom_right; 50 gfx::PointF uv_bottom_right;
49 SkColor background_color; 51 SkColor background_color;
50 float vertex_opacity[4]; 52 float vertex_opacity[4];
51 bool y_flipped; 53 bool y_flipped;
52 bool nearest_neighbor; 54 bool nearest_neighbor;
53 55
54 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } 56 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; }
57 const gfx::Size& resource_size_in_pixels() const {
58 return resources.size_in_pixels[kResourceIdIndex];
59 }
60 void set_resource_size_in_pixels(const gfx::Size& size_in_pixels) {
61 resources.size_in_pixels[kResourceIdIndex] = size_in_pixels;
62 }
63 bool allow_overlay() const {
64 return resources.allow_overlay[kResourceIdIndex];
65 }
66 void set_allow_overlay(bool allow_overlay) {
67 resources.allow_overlay[kResourceIdIndex] = allow_overlay;
68 }
55 69
56 static const TextureDrawQuad* MaterialCast(const DrawQuad*); 70 static const TextureDrawQuad* MaterialCast(const DrawQuad*);
57 71
58 private: 72 private:
59 static const size_t kResourceIdIndex = 0; 73 static const size_t kResourceIdIndex = 0;
60 74
61 void ExtendValue(base::trace_event::TracedValue* value) const override; 75 void ExtendValue(base::trace_event::TracedValue* value) const override;
62 }; 76 };
63 77
64 } // namespace cc 78 } // namespace cc
65 79
66 #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_ 80 #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698