| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 gfx::Rect opaque_rect = root_output_rect; | 106 gfx::Rect opaque_rect = root_output_rect; |
| 107 gfx::Rect visible_rect = root_output_rect; | 107 gfx::Rect visible_rect = root_output_rect; |
| 108 // An invalid resource id! The resource isn't part of the frame. | 108 // An invalid resource id! The resource isn't part of the frame. |
| 109 unsigned resource_id = 5; | 109 unsigned resource_id = 5; |
| 110 bool premultiplied_alpha = false; | 110 bool premultiplied_alpha = false; |
| 111 gfx::PointF uv_top_left = gfx::PointF(0.f, 0.f); | 111 gfx::PointF uv_top_left = gfx::PointF(0.f, 0.f); |
| 112 gfx::PointF uv_bottom_right = gfx::PointF(1.f, 1.f); | 112 gfx::PointF uv_bottom_right = gfx::PointF(1.f, 1.f); |
| 113 SkColor background_color = 0; | 113 SkColor background_color = 0; |
| 114 float vertex_opacity[4] = {1.f, 1.f, 1.f, 1.f}; | 114 float vertex_opacity[4] = {1.f, 1.f, 1.f, 1.f}; |
| 115 bool flipped = false; | 115 bool flipped = false; |
| 116 bool nearest_neighbor = false; |
| 116 | 117 |
| 117 TextureDrawQuad* invalid_draw_quad = | 118 TextureDrawQuad* invalid_draw_quad = |
| 118 root_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 119 root_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 119 invalid_draw_quad->SetNew(shared_quad_state, | 120 invalid_draw_quad->SetNew(shared_quad_state, |
| 120 rect, | 121 rect, |
| 121 opaque_rect, | 122 opaque_rect, |
| 122 visible_rect, | 123 visible_rect, |
| 123 resource_id, | 124 resource_id, |
| 124 premultiplied_alpha, | 125 premultiplied_alpha, |
| 125 uv_top_left, | 126 uv_top_left, |
| 126 uv_bottom_right, | 127 uv_bottom_right, |
| 127 background_color, | 128 background_color, |
| 128 vertex_opacity, | 129 vertex_opacity, |
| 129 flipped); | 130 flipped, |
| 131 nearest_neighbor); |
| 130 | 132 |
| 131 frame->render_pass_list.push_back(root_pass.Pass()); | 133 frame->render_pass_list.push_back(root_pass.Pass()); |
| 132 return frame.Pass(); | 134 return frame.Pass(); |
| 133 } | 135 } |
| 134 | 136 |
| 135 void AddTransferableResource(DelegatedFrameData* frame, | 137 void AddTransferableResource(DelegatedFrameData* frame, |
| 136 ResourceProvider::ResourceId resource_id) { | 138 ResourceProvider::ResourceId resource_id) { |
| 137 TransferableResource resource; | 139 TransferableResource resource; |
| 138 resource.id = resource_id; | 140 resource.id = resource_id; |
| 139 resource.mailbox_holder.texture_target = GL_TEXTURE_2D; | 141 resource.mailbox_holder.texture_target = GL_TEXTURE_2D; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 155 quad->SetNew(sqs, | 157 quad->SetNew(sqs, |
| 156 gfx::Rect(0, 0, 10, 10), | 158 gfx::Rect(0, 0, 10, 10), |
| 157 gfx::Rect(0, 0, 10, 10), | 159 gfx::Rect(0, 0, 10, 10), |
| 158 gfx::Rect(0, 0, 10, 10), | 160 gfx::Rect(0, 0, 10, 10), |
| 159 resource_id, | 161 resource_id, |
| 160 false, | 162 false, |
| 161 gfx::PointF(0.f, 0.f), | 163 gfx::PointF(0.f, 0.f), |
| 162 gfx::PointF(1.f, 1.f), | 164 gfx::PointF(1.f, 1.f), |
| 163 SK_ColorTRANSPARENT, | 165 SK_ColorTRANSPARENT, |
| 164 vertex_opacity, | 166 vertex_opacity, |
| 167 false, |
| 165 false); | 168 false); |
| 166 } | 169 } |
| 167 | 170 |
| 168 void AddRenderPass(DelegatedFrameData* frame, | 171 void AddRenderPass(DelegatedFrameData* frame, |
| 169 RenderPassId id, | 172 RenderPassId id, |
| 170 const gfx::Rect& output_rect, | 173 const gfx::Rect& output_rect, |
| 171 const gfx::Rect& damage_rect, | 174 const gfx::Rect& damage_rect, |
| 172 const FilterOperations& filters, | 175 const FilterOperations& filters, |
| 173 const FilterOperations& background_filters) { | 176 const FilterOperations& background_filters) { |
| 174 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) | 177 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) |
| (...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 } | 2169 } |
| 2167 | 2170 |
| 2168 scoped_refptr<DelegatedRendererLayer> delegated_thief_; | 2171 scoped_refptr<DelegatedRendererLayer> delegated_thief_; |
| 2169 }; | 2172 }; |
| 2170 | 2173 |
| 2171 SINGLE_AND_MULTI_THREAD_TEST_F( | 2174 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 2172 LayerTreeHostDelegatedTestRemoveAndChangeResources); | 2175 LayerTreeHostDelegatedTestRemoveAndChangeResources); |
| 2173 | 2176 |
| 2174 } // namespace | 2177 } // namespace |
| 2175 } // namespace cc | 2178 } // namespace cc |
| OLD | NEW |