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

Side by Side Diff: ui/gfx/canvas_paint_mac.mm

Issue 1462163002: Move uncoupled code out of skia/ext/platform_device.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-draft-metadata
Patch Set: Trim superfluous SK_API Created 5 years 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 | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | 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) 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/canvas_paint_mac.h" 5 #include "ui/gfx/canvas_paint_mac.h"
6 #include "ui/gfx/geometry/size.h" 6 #include "ui/gfx/geometry/size.h"
7 7
8 namespace gfx { 8 namespace gfx {
9 9
10 CanvasSkiaPaint::CanvasSkiaPaint(NSRect dirtyRect) 10 CanvasSkiaPaint::CanvasSkiaPaint(NSRect dirtyRect)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 gfx::Size size(NSWidth(rectangle_), NSHeight(rectangle_)); 61 gfx::Size size(NSWidth(rectangle_), NSHeight(rectangle_));
62 RecreateBackingCanvas(size, scale, opaque); 62 RecreateBackingCanvas(size, scale, opaque);
63 skia::PlatformCanvas* canvas = platform_canvas(); 63 skia::PlatformCanvas* canvas = platform_canvas();
64 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); 64 canvas->clear(SkColorSetARGB(0, 0, 0, 0));
65 65
66 // Need to translate so that the dirty region appears at the origin of the 66 // Need to translate so that the dirty region appears at the origin of the
67 // surface. 67 // surface.
68 canvas->translate(-SkDoubleToScalar(NSMinX(rectangle_)), 68 canvas->translate(-SkDoubleToScalar(NSMinX(rectangle_)),
69 -SkDoubleToScalar(NSMinY(rectangle_))); 69 -SkDoubleToScalar(NSMinY(rectangle_)));
70 70
71 context_ = skia::GetBitmapContext(skia::GetTopDevice(*canvas)); 71 context_ = skia::GetBitmapContext(*canvas);
72 } 72 }
73 73
74 } // namespace skia 74 } // namespace skia
75 75
76 76
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698