OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 0, device_scale_factor_, 0, | 550 0, device_scale_factor_, 0, |
551 0, 0, 1); | 551 0, 0, 1); |
552 // Start with the inverse matrix of above. | 552 // Start with the inverse matrix of above. |
553 Transform transform; | 553 Transform transform; |
554 transform.matrix().set3x3(1.0f / device_scale_factor_, 0, 0, | 554 transform.matrix().set3x3(1.0f / device_scale_factor_, 0, 0, |
555 0, 1.0f / device_scale_factor_, 0, | 555 0, 1.0f / device_scale_factor_, 0, |
556 0, 0, 1); | 556 0, 0, 1); |
557 transform.ConcatTransform(transform_); | 557 transform.ConcatTransform(transform_); |
558 transform.ConcatTranslate(bounds_.x(), bounds_.y()); | 558 transform.ConcatTranslate(bounds_.x(), bounds_.y()); |
559 transform.ConcatTransform(scale_translate); | 559 transform.ConcatTransform(scale_translate); |
560 | |
561 if (texture_) | |
562 transform.ConcatScale(device_scale_factor_, device_scale_factor_); | |
oshima
2012/05/09 19:57:21
move this before ConcatTransform(scale_translate);
| |
563 | |
560 web_layer_.setTransform(transform.matrix()); | 564 web_layer_.setTransform(transform.matrix()); |
561 } else { | 565 } else { |
562 Transform t = transform_; | 566 Transform t = transform_; |
563 t.ConcatTranslate(bounds_.x(), bounds_.y()); | 567 t.ConcatTranslate(bounds_.x(), bounds_.y()); |
564 web_layer_.setTransform(t.matrix()); | 568 web_layer_.setTransform(t.matrix()); |
565 } | 569 } |
566 } | 570 } |
567 | 571 |
568 void Layer::RecomputeDrawsContentAndUVRect() { | 572 void Layer::RecomputeDrawsContentAndUVRect() { |
569 DCHECK(!web_layer_.isNull()); | 573 DCHECK(!web_layer_.isNull()); |
(...skipping 27 matching lines...) Expand all Loading... | |
597 return; | 601 return; |
598 unsigned int color = 0xFF000000; | 602 unsigned int color = 0xFF000000; |
599 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; | 603 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; |
600 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); | 604 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); |
601 if (!opaque) | 605 if (!opaque) |
602 color |= 0xFF; | 606 color |= 0xFF; |
603 web_layer_.setDebugBorderColor(color); | 607 web_layer_.setDebugBorderColor(color); |
604 } | 608 } |
605 | 609 |
606 } // namespace ui | 610 } // namespace ui |
OLD | NEW |