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

Side by Side Diff: sky/engine/core/rendering/RenderHTMLCanvas.cpp

Issue 711203002: Remove zoom() and effectiveZoom(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 canvas->paint(context, paintRect); 78 canvas->paint(context, paintRect);
79 context->setImageInterpolationQuality(previousInterpolationQuality); 79 context->setImageInterpolationQuality(previousInterpolationQuality);
80 80
81 if (clip) 81 if (clip)
82 context->restore(); 82 context->restore();
83 } 83 }
84 84
85 void RenderHTMLCanvas::canvasSizeChanged() 85 void RenderHTMLCanvas::canvasSizeChanged()
86 { 86 {
87 IntSize canvasSize = toHTMLCanvasElement(node())->size(); 87 IntSize canvasSize = toHTMLCanvasElement(node())->size();
88 LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasS ize.height() * style()->effectiveZoom());
89 88
90 if (zoomedSize == intrinsicSize()) 89 if (canvasSize == intrinsicSize())
91 return; 90 return;
92 91
93 setIntrinsicSize(zoomedSize); 92 setIntrinsicSize(canvasSize);
94 93
95 if (!parent()) 94 if (!parent())
96 return; 95 return;
97 96
98 if (!preferredLogicalWidthsDirty()) 97 if (!preferredLogicalWidthsDirty())
99 setPreferredLogicalWidthsDirty(); 98 setPreferredLogicalWidthsDirty();
100 99
101 LayoutSize oldSize = size(); 100 LayoutSize oldSize = size();
102 updateLogicalWidth(); 101 updateLogicalWidth();
103 updateLogicalHeight(); 102 updateLogicalHeight();
104 if (oldSize == size()) 103 if (oldSize == size())
105 return; 104 return;
106 105
107 if (!selfNeedsLayout()) 106 if (!selfNeedsLayout())
108 setNeedsLayoutAndFullPaintInvalidation(); 107 setNeedsLayoutAndFullPaintInvalidation();
109 } 108 }
110 109
111 CompositingReasons RenderHTMLCanvas::additionalCompositingReasons() const 110 CompositingReasons RenderHTMLCanvas::additionalCompositingReasons() const
112 { 111 {
113 HTMLCanvasElement* canvas = toHTMLCanvasElement(node()); 112 HTMLCanvasElement* canvas = toHTMLCanvasElement(node());
114 if (canvas->renderingContext() && canvas->renderingContext()->isAccelerated( )) 113 if (canvas->renderingContext() && canvas->renderingContext()->isAccelerated( ))
115 return CompositingReasonCanvas; 114 return CompositingReasonCanvas;
116 115
117 return CompositingReasonNone; 116 return CompositingReasonNone;
118 } 117 }
119 118
120 } // namespace blink 119 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBoxModelObject.cpp ('k') | sky/engine/core/rendering/RenderImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698