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

Side by Side Diff: cc/quads/tile_draw_quad.cc

Issue 1380653003: Mac Overlays: Allow SolidColor and Tile quads to be candidates for overlays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AllOrNothing2
Patch Set: Plumb allow_overlay Created 5 years, 2 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 #include "cc/quads/tile_draw_quad.h" 5 #include "cc/quads/tile_draw_quad.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/trace_event/trace_event_argument.h" 8 #include "base/trace_event/trace_event_argument.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 TileDrawQuad::TileDrawQuad() { 13 TileDrawQuad::TileDrawQuad() {
14 } 14 }
15 15
16 TileDrawQuad::~TileDrawQuad() { 16 TileDrawQuad::~TileDrawQuad() {
17 } 17 }
18 18
19 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state, 19 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
20 const gfx::Rect& rect, 20 const gfx::Rect& rect,
21 const gfx::Rect& opaque_rect, 21 const gfx::Rect& opaque_rect,
22 const gfx::Rect& visible_rect, 22 const gfx::Rect& visible_rect,
23 unsigned resource_id, 23 unsigned resource_id,
24 const gfx::RectF& tex_coord_rect, 24 const gfx::RectF& tex_coord_rect,
25 const gfx::Size& texture_size, 25 const gfx::Size& texture_size,
26 bool swizzle_contents, 26 bool swizzle_contents,
27 bool nearest_neighbor) { 27 bool nearest_neighbor,
28 bool allow_overlay) {
28 ContentDrawQuadBase::SetNew(shared_quad_state, 29 ContentDrawQuadBase::SetNew(shared_quad_state,
29 DrawQuad::TILED_CONTENT, 30 DrawQuad::TILED_CONTENT,
30 rect, 31 rect,
31 opaque_rect, 32 opaque_rect,
32 visible_rect, 33 visible_rect,
33 tex_coord_rect, 34 tex_coord_rect,
34 texture_size, 35 texture_size,
35 swizzle_contents, 36 swizzle_contents,
36 nearest_neighbor); 37 nearest_neighbor,
38 allow_overlay);
37 resources.ids[kResourceIdIndex] = resource_id; 39 resources.ids[kResourceIdIndex] = resource_id;
38 resources.count = 1; 40 resources.count = 1;
39 } 41 }
40 42
41 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state, 43 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
42 const gfx::Rect& rect, 44 const gfx::Rect& rect,
43 const gfx::Rect& opaque_rect, 45 const gfx::Rect& opaque_rect,
44 const gfx::Rect& visible_rect, 46 const gfx::Rect& visible_rect,
45 bool needs_blending, 47 bool needs_blending,
46 unsigned resource_id, 48 unsigned resource_id,
47 const gfx::RectF& tex_coord_rect, 49 const gfx::RectF& tex_coord_rect,
48 const gfx::Size& texture_size, 50 const gfx::Size& texture_size,
49 bool swizzle_contents, 51 bool swizzle_contents,
50 bool nearest_neighbor) { 52 bool nearest_neighbor,
53 bool allow_overlay) {
51 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect, 54 ContentDrawQuadBase::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
52 opaque_rect, visible_rect, needs_blending, 55 opaque_rect, visible_rect, needs_blending,
53 tex_coord_rect, texture_size, swizzle_contents, 56 tex_coord_rect, texture_size, swizzle_contents,
54 nearest_neighbor); 57 nearest_neighbor, allow_overlay);
55 resources.ids[kResourceIdIndex] = resource_id; 58 resources.ids[kResourceIdIndex] = resource_id;
56 resources.count = 1; 59 resources.count = 1;
57 } 60 }
58 61
59 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) { 62 const TileDrawQuad* TileDrawQuad::MaterialCast(const DrawQuad* quad) {
60 DCHECK(quad->material == DrawQuad::TILED_CONTENT); 63 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
61 return static_cast<const TileDrawQuad*>(quad); 64 return static_cast<const TileDrawQuad*>(quad);
62 } 65 }
63 66
64 void TileDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const { 67 void TileDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const {
65 ContentDrawQuadBase::ExtendValue(value); 68 ContentDrawQuadBase::ExtendValue(value);
66 value->SetInteger("resource_id", resources.ids[kResourceIdIndex]); 69 value->SetInteger("resource_id", resources.ids[kResourceIdIndex]);
67 } 70 }
68 71
69 } // namespace cc 72 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698