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

Side by Side Diff: ui/gfx/transform_skia.cc

Issue 6993002: Adds assignment operator like function to Transform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/transform_skia.h ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/transform_skia.h" 5 #include "ui/gfx/transform_skia.h"
6 6
7 #include "third_party/skia/include/core/SkMatrix.h" 7 #include "third_party/skia/include/core/SkMatrix.h"
8 #include "ui/gfx/canvas_skia.h" 8 #include "ui/gfx/canvas_skia.h"
9 #include "ui/gfx/point.h" 9 #include "ui/gfx/point.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 bool TransformSkia::TransformRect(gfx::Rect* rect) { 95 bool TransformSkia::TransformRect(gfx::Rect* rect) {
96 SkRect src = gfx::RectToSkRect(*rect); 96 SkRect src = gfx::RectToSkRect(*rect);
97 if (!matrix_->mapRect(&src)) 97 if (!matrix_->mapRect(&src))
98 return false; 98 return false;
99 gfx::Rect xrect = gfx::SkRectToRect(src); 99 gfx::Rect xrect = gfx::SkRectToRect(src);
100 rect->SetRect(xrect.x(), xrect.y(), xrect.width(), xrect.height()); 100 rect->SetRect(xrect.x(), xrect.y(), xrect.width(), xrect.height());
101 return true; 101 return true;
102 } 102 }
103 103
104 void TransformSkia::Copy(const Transform& transform) {
105 *matrix_ = *(static_cast<const TransformSkia&>(transform).matrix_);
106 }
107
104 } // namespace ui 108 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/transform_skia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698