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

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

Issue 669123002: Fixed Shadow blur for transparent objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added missing virtual layout test to TestExpectations Created 6 years, 1 month 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // Instead of being dispatched to the active canvas, draw commands following beginRecording() 335 // Instead of being dispatched to the active canvas, draw commands following beginRecording()
336 // are stored in a display list that can be replayed at a later time. Pass i n the bounding 336 // are stored in a display list that can be replayed at a later time. Pass i n the bounding
337 // rectangle for the content in the list. 337 // rectangle for the content in the list.
338 void beginRecording(const FloatRect&, uint32_t = 0); 338 void beginRecording(const FloatRect&, uint32_t = 0);
339 PassRefPtr<DisplayList> endRecording(); 339 PassRefPtr<DisplayList> endRecording();
340 340
341 bool hasShadow() const; 341 bool hasShadow() const;
342 void setShadow(const FloatSize& offset, float blur, const Color&, 342 void setShadow(const FloatSize& offset, float blur, const Color&,
343 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespec tsTransforms, 343 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespec tsTransforms,
344 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAl pha, ShadowMode = DrawShadowAndForeground); 344 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAl pha, ShadowMode = DrawShadowAndForeground);
345 void clearShadow() { clearDrawLooper(); } 345 void clearShadow() { clearDrawLooper(); clearDropShadowImageFilter(); }
346 346
347 // It is assumed that this draw looper is used only for shadows 347 // It is assumed that this draw looper is used only for shadows
348 // (i.e. a draw looper is set if and only if there is a shadow). 348 // (i.e. a draw looper is set if and only if there is a shadow).
349 // The builder passed into this method will be destroyed. 349 // The builder passed into this method will be destroyed.
350 void setDrawLooper(PassOwnPtr<DrawLooperBuilder>); 350 void setDrawLooper(PassOwnPtr<DrawLooperBuilder>);
351 void clearDrawLooper(); 351 void clearDrawLooper();
352 352
353 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Colo r&); 353 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Colo r&);
354 void drawFocusRing(const Path&, int width, int offset, const Color&); 354 void drawFocusRing(const Path&, int width, int offset, const Color&);
355 355
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 void beginAnnotation(const AnnotationList&); 395 void beginAnnotation(const AnnotationList&);
396 void endAnnotation(); 396 void endAnnotation();
397 397
398 void preparePaintForDrawRectToRect( 398 void preparePaintForDrawRectToRect(
399 SkPaint*, 399 SkPaint*,
400 const SkRect& srcRect, 400 const SkRect& srcRect,
401 const SkRect& destRect, 401 const SkRect& destRect,
402 CompositeOperator, 402 CompositeOperator,
403 WebBlendMode, 403 WebBlendMode,
404 bool isBitmapWithAlpha,
404 bool isLazyDecoded = false, 405 bool isLazyDecoded = false,
405 bool isDataComplete = true) const; 406 bool isDataComplete = true) const;
406 407
407 static int focusRingOutsetExtent(int offset, int width) 408 static int focusRingOutsetExtent(int offset, int width)
408 { 409 {
409 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2; 410 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2;
410 } 411 }
411 412
412 private: 413 private:
413 const GraphicsContextState* immutableState() const { return m_paintState; } 414 const GraphicsContextState* immutableState() const { return m_paintState; }
(...skipping 29 matching lines...) Expand all
443 float prepareFocusRingPaint(SkPaint&, const Color&, int width) const; 444 float prepareFocusRingPaint(SkPaint&, const Color&, int width) const;
444 void drawFocusRingPath(const SkPath&, const Color&, int width); 445 void drawFocusRingPath(const SkPath&, const Color&, int width);
445 void drawFocusRingRect(const SkRect&, const Color&, int width); 446 void drawFocusRingRect(const SkRect&, const Color&, int width);
446 447
447 // SkCanvas wrappers. 448 // SkCanvas wrappers.
448 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op); 449 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
449 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion:: Op = SkRegion::kIntersect_Op); 450 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion:: Op = SkRegion::kIntersect_Op);
450 void concat(const SkMatrix&); 451 void concat(const SkMatrix&);
451 void drawRRect(const SkRRect&, const SkPaint&); 452 void drawRRect(const SkRRect&, const SkPaint&);
452 453
454 void setDropShadowImageFilter(PassRefPtr<SkImageFilter>);
455 void clearDropShadowImageFilter();
456 SkImageFilter* dropShadowImageFilter() const { return immutableState()->drop ShadowImageFilter(); }
457
453 // Apply deferred paint state saves 458 // Apply deferred paint state saves
454 void realizePaintSave() 459 void realizePaintSave()
455 { 460 {
456 if (contextDisabled()) 461 if (contextDisabled())
457 return; 462 return;
458 463
459 if (m_paintState->saveCount()) { 464 if (m_paintState->saveCount()) {
460 m_paintState->decrementSaveCount(); 465 m_paintState->decrementSaveCount();
461 ++m_paintStateIndex; 466 ++m_paintStateIndex;
462 if (m_paintStateStack.size() == m_paintStateIndex) { 467 if (m_paintStateStack.size() == m_paintStateIndex) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 bool m_accelerated : 1; 520 bool m_accelerated : 1;
516 bool m_isCertainlyOpaque : 1; 521 bool m_isCertainlyOpaque : 1;
517 bool m_printing : 1; 522 bool m_printing : 1;
518 bool m_antialiasHairlineImages : 1; 523 bool m_antialiasHairlineImages : 1;
519 bool m_shouldSmoothFonts : 1; 524 bool m_shouldSmoothFonts : 1;
520 }; 525 };
521 526
522 } // namespace blink 527 } // namespace blink
523 528
524 #endif // GraphicsContext_h 529 #endif // GraphicsContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698