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

Unified Diff: skia/ext/skia_utils.cc

Issue 12842: Move convolver, image_operations, and skia_utils from base/gfx to skia/ext.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/skia_utils.h ('k') | skia/ext/skia_utils_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils.cc
===================================================================
--- skia/ext/skia_utils.cc (revision 6142)
+++ skia/ext/skia_utils.cc (working copy)
@@ -2,39 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/gfx/skia_utils.h"
+#include "skia/ext/skia_utils_win.h"
-#include "base/logging.h"
#include "SkRect.h"
#include "SkGradientShader.h"
-namespace {
+namespace skia {
-COMPILE_ASSERT(offsetof(RECT, left) == offsetof(SkIRect, fLeft), o1);
-COMPILE_ASSERT(offsetof(RECT, top) == offsetof(SkIRect, fTop), o2);
-COMPILE_ASSERT(offsetof(RECT, right) == offsetof(SkIRect, fRight), o3);
-COMPILE_ASSERT(offsetof(RECT, bottom) == offsetof(SkIRect, fBottom), o4);
-COMPILE_ASSERT(sizeof(RECT().left) == sizeof(SkIRect().fLeft), o5);
-COMPILE_ASSERT(sizeof(RECT().top) == sizeof(SkIRect().fTop), o6);
-COMPILE_ASSERT(sizeof(RECT().right) == sizeof(SkIRect().fRight), o7);
-COMPILE_ASSERT(sizeof(RECT().bottom) == sizeof(SkIRect().fBottom), o8);
-COMPILE_ASSERT(sizeof(RECT) == sizeof(SkIRect), o9);
-
-} // namespace
-
-namespace gfx {
-
-POINT SkPointToPOINT(const SkPoint& point) {
- POINT win_point = { SkScalarRound(point.fX), SkScalarRound(point.fY) };
- return win_point;
-}
-
-SkRect RECTToSkRect(const RECT& rect) {
- SkRect sk_rect = { SkIntToScalar(rect.left), SkIntToScalar(rect.top),
- SkIntToScalar(rect.right), SkIntToScalar(rect.bottom) };
- return sk_rect;
-}
-
SkShader* CreateGradientShader(int start_point,
int end_point,
SkColor start_color,
@@ -48,28 +22,5 @@
grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode);
}
+} // namespace skia
-SkColor COLORREFToSkColor(COLORREF color) {
-#ifndef _MSC_VER
- return SkColorSetRGB(GetRValue(color), GetGValue(color), GetBValue(color));
-#else
- // ARGB = 0xFF000000 | ((0BGR -> RGB0) >> 8)
- return 0xFF000000u | (_byteswap_ulong(color) >> 8);
-#endif
-}
-
-COLORREF SkColorToCOLORREF(SkColor color) {
- // Currently, Alpha is always 255 or the color is 0 so there is no need to
- // demultiply the channels. If this DCHECK() is ever hit, the full
- // (SkColorGetX(color) * 255 / a) will have to be added in the conversion.
- DCHECK((0xFF == SkColorGetA(color)) || (0 == color));
-#ifndef _MSC_VER
- return RGB(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color));
-#else
- // 0BGR = ((ARGB -> BGRA) >> 8)
- return (_byteswap_ulong(color) >> 8);
-#endif
-}
-
-} // namespace gfx
-
Property changes on: skia\ext\skia_utils.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/base/gfx/skia_utils.cc:r69-2775
« no previous file with comments | « skia/ext/skia_utils.h ('k') | skia/ext/skia_utils_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698