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

Side by Side Diff: Source/core/paint/VideoPainter.cpp

Issue 1315993004: Implement a paint offset cache for slimming paint v2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase more (world moved in the past hour) Created 5 years, 3 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
« no previous file with comments | « Source/core/paint/TableSectionPainter.cpp ('k') | Source/core/paint/ViewPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/VideoPainter.h" 6 #include "core/paint/VideoPainter.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/html/HTMLVideoElement.h" 10 #include "core/html/HTMLVideoElement.h"
(...skipping 21 matching lines...) Expand all
32 GraphicsContext* context = paintInfo.context; 32 GraphicsContext* context = paintInfo.context;
33 LayoutRect contentRect = m_layoutVideo.contentBoxRect(); 33 LayoutRect contentRect = m_layoutVideo.contentBoxRect();
34 contentRect.moveBy(paintOffset); 34 contentRect.moveBy(paintOffset);
35 35
36 Optional<FloatClipRecorder> clipRecorder; 36 Optional<FloatClipRecorder> clipRecorder;
37 if (!contentRect.contains(rect)) { 37 if (!contentRect.contains(rect)) {
38 // TODO(chrishtr): this should be pixel-snapped. 38 // TODO(chrishtr): this should be pixel-snapped.
39 clipRecorder.emplace(*context, m_layoutVideo, paintInfo.phase, FloatRect (contentRect)); 39 clipRecorder.emplace(*context, m_layoutVideo, paintInfo.phase, FloatRect (contentRect));
40 } 40 }
41 41
42 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layo utVideo, paintInfo.phase)) 42 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layo utVideo, paintInfo.phase, paintOffset))
43 return; 43 return;
44 44
45 LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutVideo, paintIn fo.phase, contentRect); 45 LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutVideo, paintIn fo.phase, contentRect, paintOffset);
46 46
47 if (displayingPoster) { 47 if (displayingPoster) {
48 ImagePainter(m_layoutVideo).paintIntoRect(context, rect); 48 ImagePainter(m_layoutVideo).paintIntoRect(context, rect);
49 } else if ((paintInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLaye rs) || !m_layoutVideo.acceleratedRenderingInUse()) { 49 } else if ((paintInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLaye rs) || !m_layoutVideo.acceleratedRenderingInUse()) {
50 SkPaint videoPaint = context->fillPaint(); 50 SkPaint videoPaint = context->fillPaint();
51 videoPaint.setColor(SK_ColorBLACK); 51 videoPaint.setColor(SK_ColorBLACK);
52 m_layoutVideo.videoElement()->paintCurrentFrame(context->canvas(), pixel SnappedIntRect(rect), &videoPaint); 52 m_layoutVideo.videoElement()->paintCurrentFrame(context->canvas(), pixel SnappedIntRect(rect), &videoPaint);
53 } 53 }
54 } 54 }
55 55
56 } // namespace blink 56 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/TableSectionPainter.cpp ('k') | Source/core/paint/ViewPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698