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

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

Issue 15137009: Refactor shadow rendering logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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, 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 13 matching lines...) Expand all
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #ifndef GraphicsContext_h 28 #ifndef GraphicsContext_h
29 #define GraphicsContext_h 29 #define GraphicsContext_h
30 30
31 #include "core/platform/chromium/TraceEvent.h" 31 #include "core/platform/chromium/TraceEvent.h"
32 32
33 #include "core/platform/graphics/DashArray.h" 33 #include "core/platform/graphics/DashArray.h"
34 #include "core/platform/graphics/DrawLooper.h"
34 #include "core/platform/graphics/FloatRect.h" 35 #include "core/platform/graphics/FloatRect.h"
35 #include "core/platform/graphics/Font.h" 36 #include "core/platform/graphics/Font.h"
36 #include "core/platform/graphics/GraphicsContextState.h" 37 #include "core/platform/graphics/GraphicsContextState.h"
37 #include "core/platform/graphics/ImageOrientation.h" 38 #include "core/platform/graphics/ImageOrientation.h"
38 #include "core/platform/graphics/skia/OpaqueRegionSkia.h" 39 #include "core/platform/graphics/skia/OpaqueRegionSkia.h"
39 40
40 #include "third_party/skia/include/core/SkBitmap.h" 41 #include "third_party/skia/include/core/SkBitmap.h"
41 #include "third_party/skia/include/core/SkDevice.h" 42 #include "third_party/skia/include/core/SkDevice.h"
42 #include "third_party/skia/include/core/SkPaint.h" 43 #include "third_party/skia/include/core/SkPaint.h"
43 #include "third_party/skia/include/core/SkPath.h" 44 #include "third_party/skia/include/core/SkPath.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 void setUpdatingControlTints(bool); 316 void setUpdatingControlTints(bool);
316 317
317 void beginTransparencyLayer(float opacity); 318 void beginTransparencyLayer(float opacity);
318 void endTransparencyLayer(); 319 void endTransparencyLayer();
319 // Begins a layer that is clipped to the image |imageBuffer| at the location 320 // Begins a layer that is clipped to the image |imageBuffer| at the location
320 // |rect|. This layer is implicitly restored when the next restore is invoke d. 321 // |rect|. This layer is implicitly restored when the next restore is invoke d.
321 // NOTE: |imageBuffer| may be deleted before the |restore| is invoked. 322 // NOTE: |imageBuffer| may be deleted before the |restore| is invoked.
322 void beginLayerClippedToImage(const FloatRect&, const ImageBuffer*); 323 void beginLayerClippedToImage(const FloatRect&, const ImageBuffer*);
323 324
324 bool hasShadow() const; 325 bool hasShadow() const;
325 void setShadow(const FloatSize&, float blur, const Color&, ColorSpace); 326 void setShadow(const FloatSize& offset, float blur, const Color&,
327 DrawLooper::ShadowAlphaMode = DrawLooper::ShadowRespectsAlpha);
328 void clearShadow() { clearDrawLooper(); }
326 329
327 bool getShadow(FloatSize&, float&, Color&, ColorSpace&) const; 330 // It is assumed that this draw looper is used only for shadows
328 void clearShadow(); 331 // (i.e. a draw looper is set if and only if there is a shadow).
332 void setDrawLooper(DrawLooper&);
333 void clearDrawLooper();
329 334
330 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Colo r&); 335 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Colo r&);
331 void drawFocusRing(const Path&, int width, int offset, const Color&); 336 void drawFocusRing(const Path&, int width, int offset, const Color&);
332 337
333 void setLineCap(LineCap); 338 void setLineCap(LineCap);
334 void setLineDash(const DashArray&, float dashOffset); 339 void setLineDash(const DashArray&, float dashOffset);
335 void setLineJoin(LineJoin); 340 void setLineJoin(LineJoin);
336 void setMiterLimit(float); 341 void setMiterLimit(float);
337 342
338 void setAlpha(float); 343 void setAlpha(float);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // FIXME: Make this go away: crbug.com/236892 515 // FIXME: Make this go away: crbug.com/236892
511 bool m_updatingControlTints : 1; 516 bool m_updatingControlTints : 1;
512 bool m_accelerated : 1; 517 bool m_accelerated : 1;
513 bool m_isCertainlyOpaque : 1; 518 bool m_isCertainlyOpaque : 1;
514 bool m_printing : 1; 519 bool m_printing : 1;
515 }; 520 };
516 521
517 } // namespace WebCore 522 } // namespace WebCore
518 523
519 #endif // GraphicsContext_h 524 #endif // GraphicsContext_h
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/DrawLooper.cpp ('k') | Source/core/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698