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

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: move overlay vars out of DrawQuad::Resources 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
56 struct OverlayResources {
57 OverlayResources();
58
59 gfx::Size size_in_pixels[Resources::kMaxResourceIdCount];
60 bool allow_overlay[Resources::kMaxResourceIdCount];
61 };
62 OverlayResources overlay_resources;
63
54 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } 64 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; }
65 const gfx::Size& resource_size_in_pixels() const {
66 return overlay_resources.size_in_pixels[kResourceIdIndex];
67 }
68 void set_resource_size_in_pixels(const gfx::Size& size_in_pixels) {
69 overlay_resources.size_in_pixels[kResourceIdIndex] = size_in_pixels;
70 }
71 bool allow_overlay() const {
72 return overlay_resources.allow_overlay[kResourceIdIndex];
73 }
74 void set_allow_overlay(bool allow_overlay) {
75 overlay_resources.allow_overlay[kResourceIdIndex] = allow_overlay;
76 }
55 77
56 static const TextureDrawQuad* MaterialCast(const DrawQuad*); 78 static const TextureDrawQuad* MaterialCast(const DrawQuad*);
57 79
58 private: 80 private:
59 static const size_t kResourceIdIndex = 0; 81 static const size_t kResourceIdIndex = 0;
60 82
61 void ExtendValue(base::trace_event::TracedValue* value) const override; 83 void ExtendValue(base::trace_event::TracedValue* value) const override;
62 }; 84 };
63 85
64 } // namespace cc 86 } // namespace cc
65 87
66 #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_ 88 #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698