| 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 "ui/gfx/blit.h" | 5 #include "ui/gfx/blit.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
| 10 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/vector2d.h" | 12 #include "ui/gfx/geometry/vector2d.h" |
| 13 | 13 |
| 14 #if defined(USE_CAIRO) | 14 #if defined(USE_CAIRO) |
| 15 #if defined(OS_OPENBSD) | 15 #if defined(OS_OPENBSD) |
| 16 #include <cairo.h> | 16 #include <cairo.h> |
| 17 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 17 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 18 #include <cairo/cairo.h> | 18 #include <cairo/cairo.h> |
| 19 #endif | 19 #endif |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 #if defined(OS_MACOSX) | 22 #if defined(OS_MACOSX) |
| 23 #if defined(OS_IOS) |
| 24 #include <CoreGraphics/CoreGraphics.h> |
| 25 #else |
| 26 #include <ApplicationServices/ApplicationServices.h> |
| 27 #endif |
| 28 |
| 23 #include "base/mac/scoped_cftyperef.h" | 29 #include "base/mac/scoped_cftyperef.h" |
| 24 #endif | 30 #endif |
| 25 | 31 |
| 26 namespace gfx { | 32 namespace gfx { |
| 27 | 33 |
| 28 namespace { | 34 namespace { |
| 29 | 35 |
| 30 // Returns true if the given canvas has any part of itself clipped out or | 36 // Returns true if the given canvas has any part of itself clipped out or |
| 31 // any non-identity tranform. | 37 // any non-identity tranform. |
| 32 bool HasClipOrTransform(SkCanvas& canvas) { | 38 bool HasClipOrTransform(SkCanvas& canvas) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Fortunately, memmove already handles this for us. | 200 // Fortunately, memmove already handles this for us. |
| 195 for (int y = 0; y < dest_rect.height(); y++) { | 201 for (int y = 0; y < dest_rect.height(); y++) { |
| 196 memmove(bitmap.getAddr32(dest_rect.x(), dest_rect.y() + y), | 202 memmove(bitmap.getAddr32(dest_rect.x(), dest_rect.y() + y), |
| 197 bitmap.getAddr32(src_rect.x(), src_rect.y() + y), | 203 bitmap.getAddr32(src_rect.x(), src_rect.y() + y), |
| 198 row_bytes); | 204 row_bytes); |
| 199 } | 205 } |
| 200 } | 206 } |
| 201 } | 207 } |
| 202 | 208 |
| 203 } // namespace gfx | 209 } // namespace gfx |
| OLD | NEW |