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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 if (layer_grayscale_) { | 319 if (layer_grayscale_) { |
320 filters.append(WebKit::WebFilterOperation::createGrayscaleFilter( | 320 filters.append(WebKit::WebFilterOperation::createGrayscaleFilter( |
321 layer_grayscale_)); | 321 layer_grayscale_)); |
322 } | 322 } |
323 if (layer_inverted_) | 323 if (layer_inverted_) |
324 filters.append(WebKit::WebFilterOperation::createInvertFilter(1.0)); | 324 filters.append(WebKit::WebFilterOperation::createInvertFilter(1.0)); |
325 // Brightness goes last, because the resulting colors neeed clamping, which | 325 // Brightness goes last, because the resulting colors neeed clamping, which |
326 // cause further color matrix filters to be applied separately. In this order, | 326 // cause further color matrix filters to be applied separately. In this order, |
327 // they all can be combined in a single pass. | 327 // they all can be combined in a single pass. |
328 if (layer_brightness_) { | 328 if (layer_brightness_) { |
329 filters.append(WebKit::WebFilterOperation::createBrightnessFilter( | 329 filters.append(WebKit::WebFilterOperation::createSaturatingBrightnessFilter( |
330 layer_brightness_)); | 330 layer_brightness_)); |
331 } | 331 } |
332 | 332 |
333 cc_layer_->setFilters(filters); | 333 cc_layer_->setFilters(filters); |
334 } | 334 } |
335 | 335 |
336 void Layer::SetLayerBackgroundFilters() { | 336 void Layer::SetLayerBackgroundFilters() { |
337 WebKit::WebFilterOperations filters; | 337 WebKit::WebFilterOperations filters; |
338 if (zoom_ != 1) { | 338 if (zoom_ != 1) { |
339 filters.append(WebKit::WebFilterOperation::createZoomFilter( | 339 filters.append(WebKit::WebFilterOperation::createZoomFilter( |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 gfx::PointF uv_bottom_right( | 800 gfx::PointF uv_bottom_right( |
801 static_cast<float>(size.width())/texture_size.width(), | 801 static_cast<float>(size.width())/texture_size.width(), |
802 static_cast<float>(size.height())/texture_size.height()); | 802 static_cast<float>(size.height())/texture_size.height()); |
803 texture_layer_->setUV(uv_top_left, uv_bottom_right); | 803 texture_layer_->setUV(uv_top_left, uv_bottom_right); |
804 | 804 |
805 cc_layer_->setBounds(ConvertSizeToPixel(this, size)); | 805 cc_layer_->setBounds(ConvertSizeToPixel(this, size)); |
806 } | 806 } |
807 } | 807 } |
808 | 808 |
809 } // namespace ui | 809 } // namespace ui |
OLD | NEW |