Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: content/browser/web_contents/aura/shadow_layer_delegate.cc

Issue 1064183002: content/aura: Use gfx::Canvas::DrawRect instead of unwrapping SkCanvas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bind.h" 7 #include "base/bind.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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 skia::RefPtr<SkShader> shader = skia::AdoptRef( 44 skia::RefPtr<SkShader> shader = skia::AdoptRef(
45 SkGradientShader::CreateLinear(points, kShadowColors, NULL, 45 SkGradientShader::CreateLinear(points, kShadowColors, NULL,
46 arraysize(points), SkShader::kRepeat_TileMode)); 46 arraysize(points), SkShader::kRepeat_TileMode));
47 47
48 gfx::Rect paint_rect = gfx::Rect(0, 0, kShadowThick, 48 gfx::Rect paint_rect = gfx::Rect(0, 0, kShadowThick,
49 layer_->bounds().height()); 49 layer_->bounds().height());
50 SkPaint paint; 50 SkPaint paint;
51 paint.setShader(shader.get()); 51 paint.setShader(shader.get());
52 ui::PaintRecorder recorder(context); 52 ui::PaintRecorder recorder(context);
53 recorder.canvas()->sk_canvas()->drawRect(gfx::RectToSkRect(paint_rect), 53 recorder.canvas()->DrawRect(paint_rect, paint);
54 paint);
55 } 54 }
56 55
57 void ShadowLayerDelegate::OnDelegatedFrameDamage( 56 void ShadowLayerDelegate::OnDelegatedFrameDamage(
58 const gfx::Rect& damage_rect_in_dip) { 57 const gfx::Rect& damage_rect_in_dip) {
59 } 58 }
60 59
61 void ShadowLayerDelegate::OnDeviceScaleFactorChanged(float scale_factor) { 60 void ShadowLayerDelegate::OnDeviceScaleFactorChanged(float scale_factor) {
62 } 61 }
63 62
64 base::Closure ShadowLayerDelegate::PrepareForLayerBoundsChange() { 63 base::Closure ShadowLayerDelegate::PrepareForLayerBoundsChange() {
65 return base::Bind(&base::DoNothing); 64 return base::Bind(&base::DoNothing);
66 } 65 }
67 66
68 } // namespace content 67 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698