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 19 matching lines...) Expand all Loading... |
30 #include "config.h" | 30 #include "config.h" |
31 | 31 |
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/gfx/bitmap_header.h" | 40 #include "base/gfx/gdi_util.h" |
41 | 41 |
42 void WebCorePointToSkiaPoint(const WebCore::FloatPoint& src, SkPoint* dst) | 42 void WebCorePointToSkiaPoint(const WebCore::FloatPoint& src, SkPoint* dst) |
43 { | 43 { |
44 dst->set(WebCoreFloatToSkScalar(src.x()), WebCoreFloatToSkScalar(src.y())); | 44 dst->set(WebCoreFloatToSkScalar(src.x()), WebCoreFloatToSkScalar(src.y())); |
45 } | 45 } |
46 | 46 |
47 void WebCoreRectToSkiaRect(const WebCore::IntRect& src, SkRect* dst) | 47 void WebCoreRectToSkiaRect(const WebCore::IntRect& src, SkRect* dst) |
48 { | 48 { |
49 dst->set(SkIntToScalar(src.x()), | 49 dst->set(SkIntToScalar(src.x()), |
50 SkIntToScalar(src.y()), | 50 SkIntToScalar(src.y()), |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 buffer->append(reinterpret_cast<const char*>(&v4Header), | 253 buffer->append(reinterpret_cast<const char*>(&v4Header), |
254 sizeof(BITMAPV4HEADER)); | 254 sizeof(BITMAPV4HEADER)); |
255 | 255 |
256 // Write the image body. | 256 // Write the image body. |
257 SkAutoLockPixels bitmap_lock(bitmap); | 257 SkAutoLockPixels bitmap_lock(bitmap); |
258 buffer->append(reinterpret_cast<const char*>(bitmap.getAddr32(0, 0)), | 258 buffer->append(reinterpret_cast<const char*>(bitmap.getAddr32(0, 0)), |
259 v4Header.bV4SizeImage); | 259 v4Header.bV4SizeImage); |
260 | 260 |
261 return buffer; | 261 return buffer; |
262 } | 262 } |
OLD | NEW |