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

Unified Diff: ui/gfx/color_utils.h

Issue 7328011: Introduce ui.dll / libui.so for the component build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months 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
Index: ui/gfx/color_utils.h
===================================================================
--- ui/gfx/color_utils.h (revision 92815)
+++ ui/gfx/color_utils.h (working copy)
@@ -7,6 +7,7 @@
#pragma once
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/ui_api.h"
class SkBitmap;
@@ -22,11 +23,11 @@
unsigned char GetLuminanceForColor(SkColor color);
// Calculated according to http://www.w3.org/TR/WCAG20/#relativeluminancedef
-double RelativeLuminance(SkColor color);
+UI_API double RelativeLuminance(SkColor color);
// Note: these transformations assume sRGB as the source color space
-void SkColorToHSL(SkColor c, HSL* hsl);
-SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha);
+UI_API void SkColorToHSL(SkColor c, HSL* hsl);
+UI_API SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha);
// HSL-Shift an SkColor. The shift values are in the range of 0-1, with the
// option to specify -1 for 'no change'. The shift values are defined as:
@@ -42,7 +43,7 @@
// 0 = remove all lightness (make all pixels black).
// 0.5 = leave unchanged.
// 1 = full lightness (make all pixels white).
-SkColor HSLShift(SkColor color, const HSL& shift);
+UI_API SkColor HSLShift(SkColor color, const HSL& shift);
// Determine if a given alpha value is nearly completely transparent.
bool IsColorCloseToTransparent(SkAlpha alpha);
@@ -57,13 +58,14 @@
// Builds a histogram based on the Y' of the Y'UV representation of
// this image.
-void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
+UI_API void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
// Returns a blend of the supplied colors, ranging from |background| (for
// |alpha| == 0) to |foreground| (for |alpha| == 255). The alpha channels of
// the supplied colors are also taken into account, so the returned color may
// be partially transparent.
-SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha);
+UI_API SkColor AlphaBlend(SkColor foreground, SkColor background,
+ SkAlpha alpha);
// Given a foreground and background color, try to return a foreground color
// that is "readable" over the background color by luma-inverting the foreground
@@ -72,10 +74,10 @@
//
// NOTE: This won't do anything but waste time if the supplied foreground color
// has a luma value close to the midpoint (0.5 in the HSL representation).
-SkColor GetReadableColor(SkColor foreground, SkColor background);
+UI_API SkColor GetReadableColor(SkColor foreground, SkColor background);
// Gets a Windows system color as a SkColor
-SkColor GetSysSkColor(int which);
+UI_API SkColor GetSysSkColor(int which);
} // namespace color_utils
« no previous file with comments | « ui/gfx/color_analysis.h ('k') | ui/gfx/compositor/compositor.gyp » ('j') | ui/ui.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698