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

Side by Side Diff: Source/core/rendering/RenderVideo.cpp

Issue 21430003: Implement interfaces in PaintInfo and make it a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@getterPaintInfo01
Patch Set: Second try Created 7 years, 4 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) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf fset) 179 void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf fset)
180 { 180 {
181 MediaPlayer* mediaPlayer = mediaElement()->player(); 181 MediaPlayer* mediaPlayer = mediaElement()->player();
182 bool displayingPoster = videoElement()->shouldDisplayPosterImage(); 182 bool displayingPoster = videoElement()->shouldDisplayPosterImage();
183 183
184 Page* page = 0; 184 Page* page = 0;
185 if (Frame* frame = this->frame()) 185 if (Frame* frame = this->frame())
186 page = frame->page(); 186 page = frame->page();
187 187
188 if (!displayingPoster && !mediaPlayer) { 188 if (!displayingPoster && !mediaPlayer) {
189 if (page && paintInfo.phase == PaintPhaseForeground) 189 if (page && paintInfo.getPhase() == PaintPhaseForeground)
190 page->addRelevantUnpaintedObject(this, visualOverflowRect()); 190 page->addRelevantUnpaintedObject(this, visualOverflowRect());
191 return; 191 return;
192 } 192 }
193 193
194 LayoutRect rect = videoBox(); 194 LayoutRect rect = videoBox();
195 if (rect.isEmpty()) { 195 if (rect.isEmpty()) {
196 if (page && paintInfo.phase == PaintPhaseForeground) 196 if (page && paintInfo.getPhase() == PaintPhaseForeground)
197 page->addRelevantUnpaintedObject(this, visualOverflowRect()); 197 page->addRelevantUnpaintedObject(this, visualOverflowRect());
198 return; 198 return;
199 } 199 }
200 rect.moveBy(paintOffset); 200 rect.moveBy(paintOffset);
201 201
202 if (page && paintInfo.phase == PaintPhaseForeground) 202 if (page && paintInfo.getPhase() == PaintPhaseForeground)
203 page->addRelevantRepaintedObject(this, rect); 203 page->addRelevantRepaintedObject(this, rect);
204 204
205 if (displayingPoster) 205 if (displayingPoster)
206 paintIntoRect(paintInfo.context, rect); 206 paintIntoRect(paintInfo.getContext(), rect);
207 else if (document()->view() && document()->view()->paintBehavior() & PaintBe haviorFlattenCompositingLayers) 207 else if (document()->view() && document()->view()->paintBehavior() & PaintBe haviorFlattenCompositingLayers)
208 mediaPlayer->paintCurrentFrameInContext(paintInfo.context, pixelSnappedI ntRect(rect)); 208 mediaPlayer->paintCurrentFrameInContext(paintInfo.getContext(), pixelSna ppedIntRect(rect));
209 else 209 else
210 mediaPlayer->paint(paintInfo.context, pixelSnappedIntRect(rect)); 210 mediaPlayer->paint(paintInfo.getContext(), pixelSnappedIntRect(rect));
211 } 211 }
212 212
213 void RenderVideo::layout() 213 void RenderVideo::layout()
214 { 214 {
215 StackStats::LayoutCheckPoint layoutCheckPoint; 215 StackStats::LayoutCheckPoint layoutCheckPoint;
216 RenderMedia::layout(); 216 RenderMedia::layout();
217 updatePlayer(); 217 updatePlayer();
218 } 218 }
219 219
220 HTMLVideoElement* RenderVideo::videoElement() const 220 HTMLVideoElement* RenderVideo::videoElement() const
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 303
304 LayoutUnit RenderVideo::offsetHeight() const 304 LayoutUnit RenderVideo::offsetHeight() const
305 { 305 {
306 if (const RenderBlock* block = rendererPlaceholder(this)) 306 if (const RenderBlock* block = rendererPlaceholder(this))
307 return block->offsetHeight(); 307 return block->offsetHeight();
308 return RenderMedia::offsetHeight(); 308 return RenderMedia::offsetHeight();
309 } 309 }
310 310
311 } // namespace WebCore 311 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698