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

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 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 { 1706 {
1707 SkPaint defaultPaint; 1707 SkPaint defaultPaint;
1708 SkASSERT(*paint == defaultPaint); 1708 SkASSERT(*paint == defaultPaint);
1709 } 1709 }
1710 #endif 1710 #endif
1711 1711
1712 paint->setAntiAlias(m_state->m_shouldAntialias); 1712 paint->setAntiAlias(m_state->m_shouldAntialias);
1713 1713
1714 if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode )) 1714 if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode ))
1715 paint->setXfermode(m_state->m_xferMode.get()); 1715 paint->setXfermode(m_state->m_xferMode.get());
1716 if (this->drawLuminanceMask())
1717 paint->setXfermode(SkLumaMaskXfermode::Create(SkXfermode::kSrcOver_Mode) );
1716 1718
1717 if (m_state->m_looper) 1719 if (m_state->m_looper)
1718 paint->setLooper(m_state->m_looper.get()); 1720 paint->setLooper(m_state->m_looper.get());
1719 1721
1720 paint->setColorFilter(m_state->m_colorFilter.get()); 1722 paint->setColorFilter(m_state->m_colorFilter.get());
1721 } 1723 }
1722 1724
1723 void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int widt h) 1725 void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int widt h)
1724 { 1726 {
1725 #if OS(MACOSX) 1727 #if OS(MACOSX)
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 1877
1876 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) 1878 void GraphicsContext::didDrawTextInRect(const SkRect& textRect)
1877 { 1879 {
1878 if (m_trackTextRegion) { 1880 if (m_trackTextRegion) {
1879 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); 1881 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
1880 m_textRegion.join(textRect); 1882 m_textRegion.join(textRect);
1881 } 1883 }
1882 } 1884 }
1883 1885
1884 } 1886 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698