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

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

Issue 323013004: Clean up transform methods in GraphicsContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2nd Attempt Mac build fix 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
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 typedef unsigned Edges; 364 typedef unsigned Edges;
365 void drawInnerShadow(const RoundedRect&, const Color& shadowColor, const Int Size shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges = NoEdge ); 365 void drawInnerShadow(const RoundedRect&, const Color& shadowColor, const Int Size shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges = NoEdge );
366 366
367 // This clip function is used only by <canvas> code. It allows 367 // This clip function is used only by <canvas> code. It allows
368 // implementations to handle clipping on the canvas differently since 368 // implementations to handle clipping on the canvas differently since
369 // the discipline is different. 369 // the discipline is different.
370 void canvasClip(const Path&, WindRule = RULE_EVENODD); 370 void canvasClip(const Path&, WindRule = RULE_EVENODD);
371 void clipOut(const Path&); 371 void clipOut(const Path&);
372 372
373 // ---------- Transformation methods ----------------- 373 // ---------- Transformation methods -----------------
374 enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDevic eScale }; 374 // Note that the getCTM method returns only the current transform from Blink 's perspective,
375 AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDevi ceScale) const; 375 // which is not the final transform used to place content on screen. It cann ot be relied upon
376 // for testing where a point will appear on screen or how large it will be.
377 AffineTransform getCTM() const;
376 void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMa trix(affine)); } 378 void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMa trix(affine)); }
377 void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMa trix(affine)); } 379 void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMa trix(affine)); }
378 void setMatrix(const SkMatrix&); 380 void setMatrix(const SkMatrix&);
379 381
380 void scale(const FloatSize&); 382 void scale(float x, float y);
381 void rotate(float angleInRadians); 383 void rotate(float angleInRadians);
382 void translate(const FloatSize& size) { translate(size.width(), size.height( )); }
383 void translate(float x, float y); 384 void translate(float x, float y);
384 385
385 // This function applies the device scale factor to the context, making the context capable of 386 // This function applies the device scale factor to the context, making the context capable of
386 // acting as a base-level context for a HiDPI environment. 387 // acting as a base-level context for a HiDPI environment.
387 void applyDeviceScaleFactor(float deviceScaleFactor) { scale(FloatSize(devic eScaleFactor, deviceScaleFactor)); } 388 void applyDeviceScaleFactor(float deviceScaleFactor) { scale(deviceScaleFact or, deviceScaleFactor); }
388 // ---------- End transformation methods ----------------- 389 // ---------- End transformation methods -----------------
389 390
390 // URL drawing 391 // URL drawing
391 void setURLForRect(const KURL&, const IntRect&); 392 void setURLForRect(const KURL&, const IntRect&);
392 void setURLFragmentForRect(const String& name, const IntRect&); 393 void setURLFragmentForRect(const String& name, const IntRect&);
393 void addURLTargetAtPoint(const String& name, const IntPoint&); 394 void addURLTargetAtPoint(const String& name, const IntPoint&);
394 bool supportsURLFragments() { return printing(); } 395 bool supportsURLFragments() { return printing(); }
395 396
396 // Create an image buffer compatible with this context, with suitable resolu tion 397 // Create an image buffer compatible with this context, with suitable resolu tion
397 // for drawing into the buffer and then into this context. 398 // for drawing into the buffer and then into this context.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 bool m_updatingControlTints : 1; 538 bool m_updatingControlTints : 1;
538 bool m_accelerated : 1; 539 bool m_accelerated : 1;
539 bool m_isCertainlyOpaque : 1; 540 bool m_isCertainlyOpaque : 1;
540 bool m_printing : 1; 541 bool m_printing : 1;
541 bool m_antialiasHairlineImages : 1; 542 bool m_antialiasHairlineImages : 1;
542 }; 543 };
543 544
544 } // namespace WebCore 545 } // namespace WebCore
545 546
546 #endif // GraphicsContext_h 547 #endif // GraphicsContext_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/GradientGeneratedImage.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698