OLD | NEW |
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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 void LayerImpl::PopulateSharedQuadState(SharedQuadState* state) const { | 246 void LayerImpl::PopulateSharedQuadState(SharedQuadState* state) const { |
247 state->SetAll(draw_properties_.target_space_transform, | 247 state->SetAll(draw_properties_.target_space_transform, |
248 draw_properties_.content_bounds, | 248 draw_properties_.content_bounds, |
249 draw_properties_.visible_content_rect, | 249 draw_properties_.visible_content_rect, |
250 draw_properties_.clip_rect, | 250 draw_properties_.clip_rect, |
251 draw_properties_.is_clipped, | 251 draw_properties_.is_clipped, |
252 draw_properties_.opacity, | 252 draw_properties_.opacity, |
253 blend_mode_); | 253 blend_mode_); |
254 } | 254 } |
255 | 255 |
| 256 void LayerImpl::UpdateSharedQuadState(SharedQuadState* state, |
| 257 gfx::Transform target_space_transform, |
| 258 gfx::Size content_bounds, |
| 259 gfx::Rect visible_content_rect) const { |
| 260 state->SetAll(target_space_transform, |
| 261 content_bounds, |
| 262 visible_content_rect, |
| 263 draw_properties_.clip_rect, |
| 264 draw_properties_.is_clipped, |
| 265 draw_properties_.opacity, |
| 266 blend_mode_); |
| 267 } |
| 268 |
256 bool LayerImpl::WillDraw(DrawMode draw_mode, | 269 bool LayerImpl::WillDraw(DrawMode draw_mode, |
257 ResourceProvider* resource_provider) { | 270 ResourceProvider* resource_provider) { |
258 // WillDraw/DidDraw must be matched. | 271 // WillDraw/DidDraw must be matched. |
259 DCHECK_NE(DRAW_MODE_NONE, draw_mode); | 272 DCHECK_NE(DRAW_MODE_NONE, draw_mode); |
260 DCHECK_EQ(DRAW_MODE_NONE, current_draw_mode_); | 273 DCHECK_EQ(DRAW_MODE_NONE, current_draw_mode_); |
261 current_draw_mode_ = draw_mode; | 274 current_draw_mode_ = draw_mode; |
262 return true; | 275 return true; |
263 } | 276 } |
264 | 277 |
265 void LayerImpl::DidDraw(ResourceProvider* resource_provider) { | 278 void LayerImpl::DidDraw(ResourceProvider* resource_provider) { |
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1523 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1511 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1524 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1512 AsValueInto(state.get()); | 1525 AsValueInto(state.get()); |
1513 return state.PassAs<base::Value>(); | 1526 return state.PassAs<base::Value>(); |
1514 } | 1527 } |
1515 | 1528 |
1516 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1529 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1517 benchmark->RunOnLayer(this); | 1530 benchmark->RunOnLayer(this); |
1518 } | 1531 } |
1519 } // namespace cc | 1532 } // namespace cc |
OLD | NEW |