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

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

Issue 725043002: Remove GraphicsContext::applyDeviceScaleFactor() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/web/PageWidgetDelegate.cpp » ('j') | Source/web/PageWidgetDelegate.cpp » ('J')
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return alpha > 255 ? 255 : alpha; 171 return alpha > 255 ? 255 : alpha;
172 } 172 }
173 173
174 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta te()->setInterpolationQuality(quality); } 174 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta te()->setInterpolationQuality(quality); }
175 InterpolationQuality imageInterpolationQuality() const { return immutableSta te()->interpolationQuality(); } 175 InterpolationQuality imageInterpolationQuality() const { return immutableSta te()->interpolationQuality(); }
176 176
177 void setCompositeOperation(CompositeOperator, WebBlendMode = WebBlendModeNor mal); 177 void setCompositeOperation(CompositeOperator, WebBlendMode = WebBlendModeNor mal);
178 CompositeOperator compositeOperation() const { return immutableState()->comp ositeOperator(); } 178 CompositeOperator compositeOperation() const { return immutableState()->comp ositeOperator(); }
179 WebBlendMode blendModeOperation() const { return immutableState()->blendMode (); } 179 WebBlendMode blendModeOperation() const { return immutableState()->blendMode (); }
180 180
181 // Speicy the device scale factor which may change the way document markers 181 // Speicy the device scale factor which may change the way document markers
Stephen Chennney 2014/11/14 15:26:22 Nit: Could you fix this the typo. Speicy -> Specif
f(malita) 2014/11/14 16:41:57 Done.
182 // and fonts are rendered. 182 // and fonts are rendered.
183 void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; } 183 void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; }
184 float deviceScaleFactor() const { return m_deviceScaleFactor; } 184 float deviceScaleFactor() const { return m_deviceScaleFactor; }
185 185
186 // If true we are (most likely) rendering to a web page and the 186 // If true we are (most likely) rendering to a web page and the
187 // canvas has been prepared with an opaque background. If false, 187 // canvas has been prepared with an opaque background. If false,
188 // the canvas may have transparency (as is the case when rendering 188 // the canvas may have transparency (as is the case when rendering
189 // to a canvas object). 189 // to a canvas object).
190 void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; } 190 void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; }
191 bool isCertainlyOpaque() const { return m_isCertainlyOpaque; } 191 bool isCertainlyOpaque() const { return m_isCertainlyOpaque; }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 // which is not the final transform used to place content on screen. It cann ot be relied upon 368 // which is not the final transform used to place content on screen. It cann ot be relied upon
369 // for testing where a point will appear on screen or how large it will be. 369 // for testing where a point will appear on screen or how large it will be.
370 AffineTransform getCTM() const; 370 AffineTransform getCTM() const;
371 void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMa trix(affine)); } 371 void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMa trix(affine)); }
372 void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMa trix(affine)); } 372 void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMa trix(affine)); }
373 void setMatrix(const SkMatrix&); 373 void setMatrix(const SkMatrix&);
374 374
375 void scale(float x, float y); 375 void scale(float x, float y);
376 void rotate(float angleInRadians); 376 void rotate(float angleInRadians);
377 void translate(float x, float y); 377 void translate(float x, float y);
378
379 // This function applies the device scale factor to the context, making the context capable of
380 // acting as a base-level context for a HiDPI environment.
381 void applyDeviceScaleFactor(float deviceScaleFactor) { scale(deviceScaleFact or, deviceScaleFactor); }
382 // ---------- End transformation methods ----------------- 378 // ---------- End transformation methods -----------------
383 379
384 // URL drawing 380 // URL drawing
385 void setURLForRect(const KURL&, const IntRect&); 381 void setURLForRect(const KURL&, const IntRect&);
386 void setURLFragmentForRect(const String& name, const IntRect&); 382 void setURLFragmentForRect(const String& name, const IntRect&);
387 void addURLTargetAtPoint(const String& name, const IntPoint&); 383 void addURLTargetAtPoint(const String& name, const IntPoint&);
388 384
389 // Create an image buffer compatible with this context, with suitable resolu tion 385 // Create an image buffer compatible with this context, with suitable resolu tion
390 // for drawing into the buffer and then into this context. 386 // for drawing into the buffer and then into this context.
391 PassOwnPtr<ImageBuffer> createRasterBuffer(const IntSize&, OpacityMode = Non Opaque) const; 387 PassOwnPtr<ImageBuffer> createRasterBuffer(const IntSize&, OpacityMode = Non Opaque) const;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 unsigned m_accelerated : 1; 516 unsigned m_accelerated : 1;
521 unsigned m_isCertainlyOpaque : 1; 517 unsigned m_isCertainlyOpaque : 1;
522 unsigned m_printing : 1; 518 unsigned m_printing : 1;
523 unsigned m_antialiasHairlineImages : 1; 519 unsigned m_antialiasHairlineImages : 1;
524 unsigned m_shouldSmoothFonts : 1; 520 unsigned m_shouldSmoothFonts : 1;
525 }; 521 };
526 522
527 } // namespace blink 523 } // namespace blink
528 524
529 #endif // GraphicsContext_h 525 #endif // GraphicsContext_h
OLDNEW
« no previous file with comments | « no previous file | Source/web/PageWidgetDelegate.cpp » ('j') | Source/web/PageWidgetDelegate.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698