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

Side by Side Diff: cc/raster/skip_image_canvas.cc

Issue 2748263002: Move cc::DisplayItemList and related classes into cc/paint/ (Closed)
Patch Set: Merge branch 'master' into ccpaint Created 3 years, 9 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 | « cc/raster/skip_image_canvas.h ('k') | cc/raster/task.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "cc/playback/skip_image_canvas.h" 5 #include "cc/raster/skip_image_canvas.h"
6 6
7 #include "third_party/skia/include/core/SkShader.h" 7 #include "third_party/skia/include/core/SkShader.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 SkipImageCanvas::SkipImageCanvas(SkCanvas* canvas) 11 SkipImageCanvas::SkipImageCanvas(SkCanvas* canvas)
12 : SkPaintFilterCanvas(canvas) {} 12 : SkPaintFilterCanvas(canvas) {}
13 13
14 bool SkipImageCanvas::onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, 14 bool SkipImageCanvas::onFilter(SkTCopyOnFirstWrite<SkPaint>* paint,
15 Type type) const { 15 Type type) const {
16 if (type == kBitmap_Type) 16 if (type == kBitmap_Type)
17 return false; 17 return false;
18 18
19 SkShader* shader = (*paint) ? (*paint)->getShader() : nullptr; 19 SkShader* shader = (*paint) ? (*paint)->getShader() : nullptr;
20 return !shader || !shader->isAImage(); 20 return !shader || !shader->isAImage();
21 } 21 }
22 22
23 void SkipImageCanvas::onDrawPicture(const SkPicture* picture, 23 void SkipImageCanvas::onDrawPicture(const SkPicture* picture,
24 const SkMatrix* matrix, 24 const SkMatrix* matrix,
25 const SkPaint* paint) { 25 const SkPaint* paint) {
26 SkTCopyOnFirstWrite<SkPaint> filteredPaint(paint); 26 SkTCopyOnFirstWrite<SkPaint> filteredPaint(paint);
27 27
28 // To filter nested draws, we must unfurl pictures at this stage. 28 // To filter nested draws, we must unfurl pictures at this stage.
29 if (onFilter(&filteredPaint, kPicture_Type)) 29 if (onFilter(&filteredPaint, kPicture_Type))
30 SkCanvas::onDrawPicture(picture, matrix, filteredPaint); 30 SkCanvas::onDrawPicture(picture, matrix, filteredPaint);
31 } 31 }
32 32
33 } // namespace cc 33 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/skip_image_canvas.h ('k') | cc/raster/task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698