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

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

Issue 13637006: Add canvas blending modes under a runtime flag (Closed) Base URL: http://src.chromium.org/blink/trunk/
Patch Set: Created 7 years, 7 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 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 } 1814 }
1815 1815
1816 void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation , BlendMode blendMode) 1816 void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation , BlendMode blendMode)
1817 { 1817 {
1818 m_state.compositeOperator = compositeOperation; 1818 m_state.compositeOperator = compositeOperation;
1819 m_state.blendMode = blendMode; 1819 m_state.blendMode = blendMode;
1820 1820
1821 if (paintingDisabled()) 1821 if (paintingDisabled())
1822 return; 1822 return;
1823 1823
1824 m_skiaState->m_xferMode = WebCoreCompositeToSkiaComposite(compositeOperation ); 1824 m_skiaState->m_xferMode = WebCoreCompositeToSkiaComposite(compositeOperation , blendMode);
1825 } 1825 }
1826 1826
1827 CompositeOperator GraphicsContext::compositeOperation() const 1827 CompositeOperator GraphicsContext::compositeOperation() const
1828 { 1828 {
1829 return m_state.compositeOperator; 1829 return m_state.compositeOperator;
1830 } 1830 }
1831 1831
1832 BlendMode GraphicsContext::blendModeOperation() const 1832 BlendMode GraphicsContext::blendModeOperation() const
1833 { 1833 {
1834 return m_state.blendMode; 1834 return m_state.blendMode;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 SkPaint paint; 2121 SkPaint paint;
2122 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); 2122 paint.setXfermodeMode(SkXfermode::kDstIn_Mode);
2123 realizeSave(SkCanvas::kMatrixClip_SaveFlag); 2123 realizeSave(SkCanvas::kMatrixClip_SaveFlag);
2124 m_canvas->save(SkCanvas::kMatrix_SaveFlag); 2124 m_canvas->save(SkCanvas::kMatrix_SaveFlag);
2125 m_canvas->resetMatrix(); 2125 m_canvas->resetMatrix();
2126 m_canvas->drawBitmapRect(imageBuffer, 0, rect, &paint); 2126 m_canvas->drawBitmapRect(imageBuffer, 0, rect, &paint);
2127 m_canvas->restore(); 2127 m_canvas->restore();
2128 } 2128 }
2129 2129
2130 } 2130 }
OLDNEW
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/platform/graphics/skia/ImageBufferSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698