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

Side by Side Diff: Source/platform/graphics/GraphicsContext.h

Issue 661053003: Make beginLayer() and CanvasRenderingContext2D use SkXfermode::Mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase to ToT Created 5 years, 11 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, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008-2009 Torch Mobile, Inc. 3 * Copyright (C) 2008-2009 Torch Mobile, Inc.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);} 171 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);}
172 int getNormalizedAlpha() const 172 int getNormalizedAlpha() const
173 { 173 {
174 int alpha = immutableState()->alpha(); 174 int alpha = immutableState()->alpha();
175 return alpha > 255 ? 255 : alpha; 175 return alpha > 255 ? 255 : alpha;
176 } 176 }
177 177
178 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta te()->setInterpolationQuality(quality); } 178 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta te()->setInterpolationQuality(quality); }
179 InterpolationQuality imageInterpolationQuality() const { return immutableSta te()->interpolationQuality(); } 179 InterpolationQuality imageInterpolationQuality() const { return immutableSta te()->interpolationQuality(); }
180 180
181 void setCompositeOperation(SkXfermode::Mode);
182 // TODO(dshwang): remove these method. crbug.com/425656
181 void setCompositeOperation(CompositeOperator, WebBlendMode = WebBlendModeNor mal); 183 void setCompositeOperation(CompositeOperator, WebBlendMode = WebBlendModeNor mal);
182 CompositeOperator compositeOperation() const { return immutableState()->comp ositeOperator(); } 184 CompositeOperator compositeOperation() const;
183 WebBlendMode blendModeOperation() const { return immutableState()->blendMode (); } 185 WebBlendMode blendModeOperation() const;
184 186
185 // Specify the device scale factor which may change the way document markers 187 // Specify the device scale factor which may change the way document markers
186 // and fonts are rendered. 188 // and fonts are rendered.
187 void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; } 189 void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; }
188 float deviceScaleFactor() const { return m_deviceScaleFactor; } 190 float deviceScaleFactor() const { return m_deviceScaleFactor; }
189 191
190 // If true we are (most likely) rendering to a web page and the 192 // If true we are (most likely) rendering to a web page and the
191 // canvas has been prepared with an opaque background. If false, 193 // canvas has been prepared with an opaque background. If false,
192 // the canvas may have transparency (as is the case when rendering 194 // the canvas may have transparency (as is the case when rendering
193 // to a canvas object). 195 // to a canvas object).
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 316
315 void drawLineForText(const FloatPoint&, float width, bool printing); 317 void drawLineForText(const FloatPoint&, float width, bool printing);
316 enum DocumentMarkerLineStyle { 318 enum DocumentMarkerLineStyle {
317 DocumentMarkerSpellingLineStyle, 319 DocumentMarkerSpellingLineStyle,
318 DocumentMarkerGrammarLineStyle 320 DocumentMarkerGrammarLineStyle
319 }; 321 };
320 void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarke rLineStyle); 322 void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarke rLineStyle);
321 323
322 // beginLayer()/endLayer() behaves like save()/restore() for only CTM and cl ip states. 324 // beginLayer()/endLayer() behaves like save()/restore() for only CTM and cl ip states.
323 void beginTransparencyLayer(float opacity, const FloatRect* = 0); 325 void beginTransparencyLayer(float opacity, const FloatRect* = 0);
324 // Apply CompositeOperator when the layer is composited on the backdrop (i.e . endLayer()). 326 // Apply SkXfermode::Mode when the layer is composited on the backdrop (i.e. endLayer()).
325 // Don't change the current CompositeOperator state. 327 // Don't change the current SkXfermode::Mode states.
326 void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, Colo rFilter = ColorFilterNone, ImageFilter* = 0); 328 void beginLayer(float opacity, SkXfermode::Mode, const FloatRect* = 0, Color Filter = ColorFilterNone, ImageFilter* = 0);
327 void endLayer(); 329 void endLayer();
328 330
329 // Instead of being dispatched to the active canvas, draw commands following beginRecording() 331 // Instead of being dispatched to the active canvas, draw commands following beginRecording()
330 // are stored in a display list that can be replayed at a later time. Pass i n the bounding 332 // are stored in a display list that can be replayed at a later time. Pass i n the bounding
331 // rectangle for the content in the list. 333 // rectangle for the content in the list.
332 void beginRecording(const FloatRect&, uint32_t = 0); 334 void beginRecording(const FloatRect&, uint32_t = 0);
333 PassRefPtr<const SkPicture> endRecording(); 335 PassRefPtr<const SkPicture> endRecording();
334 336
335 bool hasShadow() const; 337 bool hasShadow() const;
336 void setShadow(const FloatSize& offset, float blur, const Color&, 338 void setShadow(const FloatSize& offset, float blur, const Color&,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 unsigned m_accelerated : 1; 525 unsigned m_accelerated : 1;
524 unsigned m_isCertainlyOpaque : 1; 526 unsigned m_isCertainlyOpaque : 1;
525 unsigned m_printing : 1; 527 unsigned m_printing : 1;
526 unsigned m_antialiasHairlineImages : 1; 528 unsigned m_antialiasHairlineImages : 1;
527 unsigned m_shouldSmoothFonts : 1; 529 unsigned m_shouldSmoothFonts : 1;
528 }; 530 };
529 531
530 } // namespace blink 532 } // namespace blink
531 533
532 #endif // GraphicsContext_h 534 #endif // GraphicsContext_h
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceMasker.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698