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 "skia/ext/skia_utils_mac.h" | 5 #include "skia/ext/skia_utils_mac.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 [image drawInRect:drawRect | 67 [image drawInRect:drawRect |
68 fromRect:NSZeroRect | 68 fromRect:NSZeroRect |
69 operation:NSCompositeCopy | 69 operation:NSCompositeCopy |
70 fraction:1.0]; | 70 fraction:1.0]; |
71 } else { | 71 } else { |
72 [image_rep drawInRect:drawRect | 72 [image_rep drawInRect:drawRect |
73 fromRect:NSZeroRect | 73 fromRect:NSZeroRect |
74 operation:NSCompositeCopy | 74 operation:NSCompositeCopy |
75 fraction:1.0 | 75 fraction:1.0 |
76 respectFlipped:NO | 76 respectFlipped:NO |
77 hints:NO]; | 77 hints:nil]; |
78 } | 78 } |
79 | 79 |
80 [NSGraphicsContext restoreGraphicsState]; | 80 [NSGraphicsContext restoreGraphicsState]; |
81 | 81 |
82 return bitmap; | 82 return bitmap; |
83 } | 83 } |
84 | 84 |
85 } // namespace | 85 } // namespace |
86 | 86 |
87 namespace gfx { | 87 namespace gfx { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Apply content matrix. | 404 // Apply content matrix. |
405 SkMatrix skMatrix = canvas_->getTotalMatrix(); | 405 SkMatrix skMatrix = canvas_->getTotalMatrix(); |
406 skMatrix.postTranslate(-SkIntToScalar(pt.fX), -SkIntToScalar(pt.fY)); | 406 skMatrix.postTranslate(-SkIntToScalar(pt.fX), -SkIntToScalar(pt.fY)); |
407 CGAffineTransform affine = SkMatrixToCGAffineTransform(skMatrix); | 407 CGAffineTransform affine = SkMatrixToCGAffineTransform(skMatrix); |
408 CGContextConcatCTM(cgContext_, affine); | 408 CGContextConcatCTM(cgContext_, affine); |
409 | 409 |
410 return cgContext_; | 410 return cgContext_; |
411 } | 411 } |
412 | 412 |
413 } // namespace gfx | 413 } // namespace gfx |
OLD | NEW |