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

Side by Side Diff: Source/core/platform/graphics/GraphicsContext.cpp

Issue 23947005: Implement CSS luminance masking using skia SkLumaMaskXfermode class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 { 1718 {
1719 SkPaint defaultPaint; 1719 SkPaint defaultPaint;
1720 SkASSERT(*paint == defaultPaint); 1720 SkASSERT(*paint == defaultPaint);
1721 } 1721 }
1722 #endif 1722 #endif
1723 1723
1724 paint->setAntiAlias(m_state->m_shouldAntialias); 1724 paint->setAntiAlias(m_state->m_shouldAntialias);
1725 1725
1726 if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode )) 1726 if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode ))
1727 paint->setXfermode(m_state->m_xferMode.get()); 1727 paint->setXfermode(m_state->m_xferMode.get());
1728 if (this->drawLuminanceMask())
1729 paint->setXfermode(SkLumaMaskXfermode::Create(SkXfermode::kSrcOver_Mode) );
1728 1730
1729 if (m_state->m_looper) 1731 if (m_state->m_looper)
1730 paint->setLooper(m_state->m_looper.get()); 1732 paint->setLooper(m_state->m_looper.get());
1731 1733
1732 paint->setColorFilter(m_state->m_colorFilter.get()); 1734 paint->setColorFilter(m_state->m_colorFilter.get());
1733 } 1735 }
1734 1736
1735 void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int widt h) 1737 void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int widt h)
1736 { 1738 {
1737 #if OS(MACOSX) 1739 #if OS(MACOSX)
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 1889
1888 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) 1890 void GraphicsContext::didDrawTextInRect(const SkRect& textRect)
1889 { 1891 {
1890 if (m_trackTextRegion) { 1892 if (m_trackTextRegion) {
1891 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); 1893 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
1892 m_textRegion.join(textRect); 1894 m_textRegion.join(textRect);
1893 } 1895 }
1894 } 1896 }
1895 1897
1896 } 1898 }
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsContext.h ('k') | Source/core/platform/graphics/GraphicsContextState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698