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

Side by Side Diff: cc/tile_draw_quad.cc

Issue 12328098: cc: Moving anti-aliasing decision to parent compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@solidaa
Patch Set: Rebase to tip of tree Created 7 years, 9 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/tile_draw_quad.h ('k') | cc/tiled_layer_impl.cc » ('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 #include "cc/tile_draw_quad.h" 5 #include "cc/tile_draw_quad.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/khronos/GLES2/gl2.h" 8 #include "third_party/khronos/GLES2/gl2.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 TileDrawQuad::TileDrawQuad() 12 TileDrawQuad::TileDrawQuad()
13 : resource_id(0), 13 : resource_id(0),
14 swizzle_contents(false), 14 swizzle_contents(false) {
15 left_edge_aa(false),
16 top_edge_aa(false),
17 right_edge_aa(false),
18 bottom_edge_aa(false) {
19 } 15 }
20 16
21 scoped_ptr<TileDrawQuad> TileDrawQuad::Create() { 17 scoped_ptr<TileDrawQuad> TileDrawQuad::Create() {
22 return make_scoped_ptr(new TileDrawQuad); 18 return make_scoped_ptr(new TileDrawQuad);
23 } 19 }
24 20
25 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state, 21 void TileDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
26 gfx::Rect rect, 22 gfx::Rect rect,
27 gfx::Rect opaque_rect, 23 gfx::Rect opaque_rect,
28 unsigned resource_id, 24 unsigned resource_id,
29 const gfx::RectF& tex_coord_rect, 25 const gfx::RectF& tex_coord_rect,
30 gfx::Size texture_size, 26 gfx::Size texture_size,
31 bool swizzle_contents, 27 bool swizzle_contents) {
32 bool left_edge_aa,
33 bool top_edge_aa,
34 bool right_edge_aa,
35 bool bottom_edge_aa) {
36 gfx::Rect visible_rect = rect; 28 gfx::Rect visible_rect = rect;
37 bool needs_blending = false; 29 bool needs_blending = false;
38 DrawQuad::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect, 30 DrawQuad::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
39 opaque_rect, visible_rect, needs_blending); 31 opaque_rect, visible_rect, needs_blending);
40 this->resource_id = resource_id; 32 this->resource_id = resource_id;
41 this->tex_coord_rect = tex_coord_rect; 33 this->tex_coord_rect = tex_coord_rect;
42 this->texture_size = texture_size; 34 this->texture_size = texture_size;
43 this->swizzle_contents = swizzle_contents; 35 this->swizzle_contents = swizzle_contents;
44 this->left_edge_aa = left_edge_aa;
45 this->top_edge_aa = top_edge_aa;
46 this->right_edge_aa = right_edge_aa;
47 this->bottom_edge_aa = bottom_edge_aa;
48
49 // Override needs_blending after initializing the quad.
50 this->needs_blending = IsAntialiased();
51 } 36 }
52 37
53 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state, 38 void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
54 gfx::Rect rect, 39 gfx::Rect rect,
55 gfx::Rect opaque_rect, 40 gfx::Rect opaque_rect,
56 gfx::Rect visible_rect, 41 gfx::Rect visible_rect,
57 bool needs_blending, 42 bool needs_blending,
58 unsigned resource_id, 43 unsigned resource_id,
59 const gfx::RectF& tex_coord_rect, 44 const gfx::RectF& tex_coord_rect,
60 gfx::Size texture_size, 45 gfx::Size texture_size,
61 bool swizzle_contents, 46 bool swizzle_contents) {
62 bool left_edge_aa,
63 bool top_edge_aa,
64 bool right_edge_aa,
65 bool bottom_edge_aa) {
66 DrawQuad::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect, 47 DrawQuad::SetAll(shared_quad_state, DrawQuad::TILED_CONTENT, rect,
67 opaque_rect, visible_rect, needs_blending); 48 opaque_rect, visible_rect, needs_blending);
68 this->resource_id = resource_id; 49 this->resource_id = resource_id;
69 this->tex_coord_rect = tex_coord_rect; 50 this->tex_coord_rect = tex_coord_rect;
70 this->texture_size = texture_size; 51 this->texture_size = texture_size;
71 this->swizzle_contents = swizzle_contents; 52 this->swizzle_contents = swizzle_contents;
72 this->left_edge_aa = left_edge_aa;
73 this->top_edge_aa = top_edge_aa;
74 this->right_edge_aa = right_edge_aa;
75 this->bottom_edge_aa = bottom_edge_aa;
76 } 53 }
77 54
78 void TileDrawQuad::IterateResources( 55 void TileDrawQuad::IterateResources(
79 const ResourceIteratorCallback& callback) { 56 const ResourceIteratorCallback& callback) {
80 resource_id = callback.Run(resource_id); 57 resource_id = callback.Run(resource_id);
81 } 58 }
82 59
83 const TileDrawQuad* TileDrawQuad::MaterialCast( 60 const TileDrawQuad* TileDrawQuad::MaterialCast(
84 const DrawQuad* quad) { 61 const DrawQuad* quad) {
85 DCHECK(quad->material == DrawQuad::TILED_CONTENT); 62 DCHECK(quad->material == DrawQuad::TILED_CONTENT);
86 return static_cast<const TileDrawQuad*>(quad); 63 return static_cast<const TileDrawQuad*>(quad);
87 } 64 }
88 65
89 } // namespace cc 66 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tile_draw_quad.h ('k') | cc/tiled_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698