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

Side by Side Diff: src/core/SkPaintPriv.cpp

Issue 1127993004: Revert of Revert of Revert of Make drawImage a virtual on SkDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « src/core/SkPaintPriv.h ('k') | src/core/SkPictureRecord.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 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPaintPriv.h" 8 #include "SkPaintPriv.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 #include "SkImage.h"
13 #include "SkPaint.h" 12 #include "SkPaint.h"
14 #include "SkShader.h" 13 #include "SkShader.h"
15 14
16 bool isPaintOpaque(const SkPaint* paint, SkPaintBitmapOpacity contentType) { 15 bool isPaintOpaque(const SkPaint* paint, SkPaintBitmapOpacity contentType) {
17 if (!paint) { 16 if (!paint) {
18 return contentType != kUnknown_SkPaintBitmapOpacity; 17 return contentType != kUnknown_SkPaintBitmapOpacity;
19 } 18 }
20 SkXfermode::SrcColorOpacity opacityType = SkXfermode::kUnknown_SrcColorOpaci ty; 19 SkXfermode::SrcColorOpacity opacityType = SkXfermode::kUnknown_SrcColorOpaci ty;
21 20
22 if (!paint->getColorFilter() || 21 if (!paint->getColorFilter() ||
(...skipping 20 matching lines...) Expand all
43 42
44 if(!bmpReplacesShader) 43 if(!bmpReplacesShader)
45 contentType = kNoBitmap_SkPaintBitmapOpacity; 44 contentType = kNoBitmap_SkPaintBitmapOpacity;
46 else if(bmpReplacesShader->isOpaque()) 45 else if(bmpReplacesShader->isOpaque())
47 contentType = kOpaque_SkPaintBitmapOpacity; 46 contentType = kOpaque_SkPaintBitmapOpacity;
48 else 47 else
49 contentType = kUnknown_SkPaintBitmapOpacity; 48 contentType = kUnknown_SkPaintBitmapOpacity;
50 49
51 return isPaintOpaque(paint, contentType); 50 return isPaintOpaque(paint, contentType);
52 } 51 }
53
54 bool isPaintOpaque(const SkPaint* paint, const SkImage* image) {
55 return isPaintOpaque(paint, image->isOpaque() ?
56 kOpaque_SkPaintBitmapOpacity : kUnknown_SkPaintBitmapOp acity);
57 }
OLDNEW
« no previous file with comments | « src/core/SkPaintPriv.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698