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

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

Issue 744163002: Enable fast/images with slimming paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix VirtualTestSuites. Created 6 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/HTMLCanvasClipper.h"
7
8 #include "core/paint/ClipRecorder.h"
9 #include "core/paint/ViewDisplayList.h"
10 #include "core/rendering/PaintInfo.h"
11 #include "core/rendering/RenderHTMLCanvas.h"
12 #include "core/rendering/RenderView.h"
13 #include "platform/RuntimeEnabledFeatures.h"
14
15 namespace blink {
16
17 HTMLCanvasClipper::HTMLCanvasClipper(RenderHTMLCanvas& canvas, const PaintInfo& paintInfo, const LayoutRect& clipRect)
chrishtr 2014/11/25 00:29:58 Can this be easily unified with BoxClipper now tha
18 : m_clipRect(clipRect)
19 , m_paintInfo(paintInfo)
20 , m_canvas(canvas)
21 {
22 DisplayItem::Type type = DisplayItem::paintPhaseToClipType(paintInfo.phase);
23 OwnPtr<ClipDisplayItem> clipDisplayItem = adoptPtr(new ClipDisplayItem(&m_ca nvas, type, pixelSnappedIntRect(clipRect)));
24
25 if (RuntimeEnabledFeatures::slimmingPaintEnabled())
26 m_canvas.view()->viewDisplayList().add(clipDisplayItem.release());
27 else
28 clipDisplayItem->replay(paintInfo.context);
29 }
30
31 HTMLCanvasClipper::~HTMLCanvasClipper()
32 {
33 OwnPtr<EndClipDisplayItem> endClipDisplayItem = adoptPtr(new EndClipDisplayI tem(&m_canvas));
34
35 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
36 m_canvas.view()->viewDisplayList().add(endClipDisplayItem.release());
37 } else {
38 endClipDisplayItem->replay(m_paintInfo.context);
39 }
40 }
41
42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698