| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "SkiaUtils.h" | 32 #include "SkiaUtils.h" |
| 33 | 33 |
| 34 #include "SharedBuffer.h" | 34 #include "SharedBuffer.h" |
| 35 #include "SkCanvas.h" | 35 #include "SkCanvas.h" |
| 36 #include "SkColorPriv.h" | 36 #include "SkColorPriv.h" |
| 37 #include "SkMatrix.h" | 37 #include "SkMatrix.h" |
| 38 #include "SkRegion.h" | 38 #include "SkRegion.h" |
| 39 | 39 |
| 40 #include "base/basictypes.h" | 40 #include "base/basictypes.h" |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 #include "base/gfx/bitmap_header.h" | 42 #include "base/gfx/gdi_util.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 void WebCorePointToSkiaPoint(const WebCore::FloatPoint& src, SkPoint* dst) | 45 void WebCorePointToSkiaPoint(const WebCore::FloatPoint& src, SkPoint* dst) |
| 46 { | 46 { |
| 47 dst->set(WebCoreFloatToSkScalar(src.x()), WebCoreFloatToSkScalar(src.y())); | 47 dst->set(WebCoreFloatToSkScalar(src.x()), WebCoreFloatToSkScalar(src.y())); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void WebCoreRectToSkiaRect(const WebCore::IntRect& src, SkRect* dst) | 50 void WebCoreRectToSkiaRect(const WebCore::IntRect& src, SkRect* dst) |
| 51 { | 51 { |
| 52 dst->set(SkIntToScalar(src.x()), | 52 dst->set(SkIntToScalar(src.x()), |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 header_size); | 276 header_size); |
| 277 | 277 |
| 278 // Skia stores colors pre-multiplied, BMP doesn't. Need to convert the | 278 // Skia stores colors pre-multiplied, BMP doesn't. Need to convert the |
| 279 // colors. | 279 // colors. |
| 280 for (int i = width * height - 1; i >= 0; --i) | 280 for (int i = width * height - 1; i >= 0; --i) |
| 281 dest_image_data[i] = SkPMColorToColor(src_image_data[i]); | 281 dest_image_data[i] = SkPMColorToColor(src_image_data[i]); |
| 282 | 282 |
| 283 return buffer; | 283 return buffer; |
| 284 } | 284 } |
| 285 #endif | 285 #endif |
| OLD | NEW |