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/gfx/image/image_skia_operations.h" | 5 #include "ui/gfx/image/image_skia_operations.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "skia/ext/image_operations.h" | 9 #include "skia/ext/image_operations.h" |
10 #include "skia/ext/platform_canvas.h" | 10 #include "skia/ext/platform_canvas.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 return ImageSkiaRep(shaodw_bitmap, image_rep.scale_factor()); | 279 return ImageSkiaRep(shaodw_bitmap, image_rep.scale_factor()); |
280 } | 280 } |
281 | 281 |
282 private: | 282 private: |
283 const ImageSkia source_; | 283 const ImageSkia source_; |
284 const ShadowValues shaodws_in_dip_; | 284 const ShadowValues shaodws_in_dip_; |
285 | 285 |
286 DISALLOW_COPY_AND_ASSIGN(DropShadowSource); | 286 DISALLOW_COPY_AND_ASSIGN(DropShadowSource); |
287 }; | 287 }; |
288 | 288 |
289 } // namespace; | 289 } // namespace |
290 | 290 |
291 // static | 291 // static |
292 ImageSkia ImageSkiaOperations::CreateBlendedImage(const ImageSkia& first, | 292 ImageSkia ImageSkiaOperations::CreateBlendedImage(const ImageSkia& first, |
293 const ImageSkia& second, | 293 const ImageSkia& second, |
294 double alpha) { | 294 double alpha) { |
295 return ImageSkia(new BlendingImageSource(first, second, alpha), first.size()); | 295 return ImageSkia(new BlendingImageSource(first, second, alpha), first.size()); |
296 } | 296 } |
297 | 297 |
298 // static | 298 // static |
299 ImageSkia ImageSkiaOperations::CreateMaskedImage(const ImageSkia& rgb, | 299 ImageSkia ImageSkiaOperations::CreateMaskedImage(const ImageSkia& rgb, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 const ImageSkia& source, | 339 const ImageSkia& source, |
340 const ShadowValues& shadows) { | 340 const ShadowValues& shadows) { |
341 const gfx::Insets shadow_padding = -gfx::ShadowValue::GetMargin(shadows); | 341 const gfx::Insets shadow_padding = -gfx::ShadowValue::GetMargin(shadows); |
342 gfx::Size shadow_image_size = source.size(); | 342 gfx::Size shadow_image_size = source.size(); |
343 shadow_image_size.Enlarge(shadow_padding.width(), | 343 shadow_image_size.Enlarge(shadow_padding.width(), |
344 shadow_padding.height()); | 344 shadow_padding.height()); |
345 return ImageSkia(new DropShadowSource(source, shadows), shadow_image_size); | 345 return ImageSkia(new DropShadowSource(source, shadows), shadow_image_size); |
346 } | 346 } |
347 | 347 |
348 } // namespace gfx | 348 } // namespace gfx |
OLD | NEW |