| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/web_contents/aura/shadow_layer_delegate.h" | 5 #include "content/browser/web_contents/aura/shadow_layer_delegate.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "third_party/skia/include/effects/SkGradientShader.h" | 8 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/compositor/layer.h" | 10 #include "ui/compositor/layer.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 void ShadowLayerDelegate::OnPaintLayer(const ui::PaintContext& context) { | 37 void ShadowLayerDelegate::OnPaintLayer(const ui::PaintContext& context) { |
| 38 SkPoint points[2]; | 38 SkPoint points[2]; |
| 39 const SkColor kShadowColors[2] = { kShadowLightColor, kShadowDarkColor }; | 39 const SkColor kShadowColors[2] = { kShadowLightColor, kShadowDarkColor }; |
| 40 | 40 |
| 41 points[0].iset(0, 0); | 41 points[0].iset(0, 0); |
| 42 points[1].iset(kShadowThick, 0); | 42 points[1].iset(kShadowThick, 0); |
| 43 | 43 |
| 44 gfx::Rect paint_rect = gfx::Rect(0, 0, kShadowThick, | 44 gfx::Rect paint_rect = gfx::Rect(0, 0, kShadowThick, |
| 45 layer_->bounds().height()); | 45 layer_->bounds().height()); |
| 46 SkPaint paint; | 46 CdlPaint paint; |
| 47 paint.setShader(SkGradientShader::MakeLinear(points, kShadowColors, NULL, | 47 paint.setShader(WrapSkShader(SkGradientShader::MakeLinear( |
| 48 arraysize(points), | 48 points, kShadowColors, NULL, arraysize(points), |
| 49 SkShader::kRepeat_TileMode)); | 49 SkShader::kRepeat_TileMode))); |
| 50 ui::PaintRecorder recorder(context, layer_->size()); | 50 ui::PaintRecorder recorder(context, layer_->size()); |
| 51 recorder.canvas()->DrawRect(paint_rect, paint); | 51 recorder.canvas()->DrawRect(paint_rect, paint); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void ShadowLayerDelegate::OnDelegatedFrameDamage( | 54 void ShadowLayerDelegate::OnDelegatedFrameDamage( |
| 55 const gfx::Rect& damage_rect_in_dip) { | 55 const gfx::Rect& damage_rect_in_dip) { |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ShadowLayerDelegate::OnDeviceScaleFactorChanged(float scale_factor) { | 58 void ShadowLayerDelegate::OnDeviceScaleFactorChanged(float scale_factor) { |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace content | 61 } // namespace content |
| OLD | NEW |