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

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

Issue 430793002: Eliminate MediaPlayer abstraction(paint APIs) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments Created 6 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 GraphicsContext* context = paintInfo.context; 163 GraphicsContext* context = paintInfo.context;
164 bool clip = !contentRect.contains(rect); 164 bool clip = !contentRect.contains(rect);
165 if (clip) { 165 if (clip) {
166 context->save(); 166 context->save();
167 context->clip(contentRect); 167 context->clip(contentRect);
168 } 168 }
169 169
170 if (displayingPoster) 170 if (displayingPoster)
171 paintIntoRect(context, rect); 171 paintIntoRect(context, rect);
172 else if ((document().view() && document().view()->paintBehavior() & PaintBeh aviorFlattenCompositingLayers) || !acceleratedRenderingInUse()) 172 else if ((document().view() && document().view()->paintBehavior() & PaintBeh aviorFlattenCompositingLayers) || !acceleratedRenderingInUse())
173 mediaPlayer->paint(context, pixelSnappedIntRect(rect)); 173 videoElement()->paintCurrentFrameInContext(context, pixelSnappedIntRect( rect));
174 174
175 if (clip) 175 if (clip)
176 context->restore(); 176 context->restore();
177 } 177 }
178 178
179 bool RenderVideo::acceleratedRenderingInUse() 179 bool RenderVideo::acceleratedRenderingInUse()
180 { 180 {
181 blink::WebLayer* webLayer = mediaElement()->platformLayer(); 181 blink::WebLayer* webLayer = mediaElement()->platformLayer();
182 return webLayer && !webLayer->isOrphan(); 182 return webLayer && !webLayer->isOrphan();
183 } 183 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 return CompositingReasonVideo; 282 return CompositingReasonVideo;
283 } 283 }
284 284
285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated Rendering()) 285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated Rendering())
286 return CompositingReasonVideo; 286 return CompositingReasonVideo;
287 287
288 return CompositingReasonNone; 288 return CompositingReasonNone;
289 } 289 }
290 290
291 } // namespace blink 291 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContextBase.cpp ('k') | Source/platform/graphics/media/MediaPlayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698