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

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

Issue 311193009: Replace GraphicsContext::setupPaintFor* with const getters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/mac/FontMac.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 AnnotationModeFlags annotationMode() const { return m_annotationMode; } 232 AnnotationModeFlags annotationMode() const { return m_annotationMode; }
233 void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; } 233 void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; }
234 234
235 SkColorFilter* colorFilter(); 235 SkColorFilter* colorFilter();
236 void setColorFilter(ColorFilter); 236 void setColorFilter(ColorFilter);
237 // ---------- End state management methods ----------------- 237 // ---------- End state management methods -----------------
238 238
239 // Get the contents of the image buffer 239 // Get the contents of the image buffer
240 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in t y); 240 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in t y);
241 241
242 // Sets up the paint for the current fill style. 242 // Get the current fill style.
243 void setupPaintForFilling(SkPaint*) const; 243 const SkPaint& fillPaint() const { return immutableState()->fillPaint(); }
244 244
245 // Sets up the paint for the current stroke style. 245 // Get the current stroke style.
246 void setupPaintForStroking(SkPaint*) const; 246 const SkPaint& strokePaint() const { return immutableState()->strokePaint(); }
247 247
248 // These draw methods will do both stroking and filling. 248 // These draw methods will do both stroking and filling.
249 // FIXME: ...except drawRect(), which fills properly but always strokes 249 // FIXME: ...except drawRect(), which fills properly but always strokes
250 // using a 1-pixel stroke inset from the rect borders (of the correct 250 // using a 1-pixel stroke inset from the rect borders (of the correct
251 // stroke color). 251 // stroke color).
252 void drawRect(const IntRect&); 252 void drawRect(const IntRect&);
253 void drawLine(const IntPoint&, const IntPoint&); 253 void drawLine(const IntPoint&, const IntPoint&);
254 void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntia lias = false); 254 void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntia lias = false);
255 255
256 void fillPath(const Path&); 256 void fillPath(const Path&);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 void drawInnerPath(const SkPath&, SkPaint&, int); 447 void drawInnerPath(const SkPath&, SkPaint&, int);
448 448
449 // SkCanvas wrappers. 449 // SkCanvas wrappers.
450 bool isDrawingToLayer() const { return m_canvas->isDrawingToLayer(); } 450 bool isDrawingToLayer() const { return m_canvas->isDrawingToLayer(); }
451 451
452 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op); 452 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
453 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion:: Op = SkRegion::kIntersect_Op); 453 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion:: Op = SkRegion::kIntersect_Op);
454 454
455 void concat(const SkMatrix&); 455 void concat(const SkMatrix&);
456 456
457 // common code between setupPaintFor[Filling,Stroking]
458 void setupShader(SkPaint*, Gradient*, Pattern*, SkColor) const;
459
460 // Apply deferred paint state saves 457 // Apply deferred paint state saves
461 void realizePaintSave() 458 void realizePaintSave()
462 { 459 {
463 if (contextDisabled()) 460 if (contextDisabled())
464 return; 461 return;
465 462
466 if (m_paintState->saveCount()) { 463 if (m_paintState->saveCount()) {
467 m_paintState->decrementSaveCount(); 464 m_paintState->decrementSaveCount();
468 ++m_paintStateIndex; 465 ++m_paintStateIndex;
469 if (m_paintStateStack.size() == m_paintStateIndex) 466 if (m_paintStateStack.size() == m_paintStateIndex)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 bool m_updatingControlTints : 1; 534 bool m_updatingControlTints : 1;
538 bool m_accelerated : 1; 535 bool m_accelerated : 1;
539 bool m_isCertainlyOpaque : 1; 536 bool m_isCertainlyOpaque : 1;
540 bool m_printing : 1; 537 bool m_printing : 1;
541 bool m_antialiasHairlineImages : 1; 538 bool m_antialiasHairlineImages : 1;
542 }; 539 };
543 540
544 } // namespace WebCore 541 } // namespace WebCore
545 542
546 #endif // GraphicsContext_h 543 #endif // GraphicsContext_h
OLDNEW
« no previous file with comments | « Source/platform/fonts/mac/FontMac.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698