OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 PassRefPtr<SkImage> imageForCurrentFrame() override | 57 PassRefPtr<SkImage> imageForCurrentFrame() override |
58 { | 58 { |
59 return m_image; | 59 return m_image; |
60 } | 60 } |
61 | 61 |
62 void destroyDecodedData() override | 62 void destroyDecodedData() override |
63 { | 63 { |
64 // Image pure virtual stub. | 64 // Image pure virtual stub. |
65 } | 65 } |
66 | 66 |
67 void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, Res
pectImageOrientationEnum, ImageClampingMode) override | 67 void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, boo
l imageSmoothingEnabled, RespectImageOrientationEnum, ImageClampingMode) overrid
e |
68 { | 68 { |
69 // Image pure virtual stub. | 69 // Image pure virtual stub. |
70 } | 70 } |
71 | 71 |
72 private: | 72 private: |
73 TestImage(IntSize size, bool opaque) | 73 TestImage(IntSize size, bool opaque) |
74 : Image(0) | 74 : Image(0) |
75 , m_size(size) | 75 , m_size(size) |
76 { | 76 { |
77 sk_sp<SkSurface> surface = createSkSurface(size, opaque); | 77 sk_sp<SkSurface> surface = createSkSurface(size, opaque); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ASSERT_FALSE(graphicsLayer->contentsLayer()); | 130 ASSERT_FALSE(graphicsLayer->contentsLayer()); |
131 | 131 |
132 graphicsLayer->setContentsToImage(opaqueImage.get()); | 132 graphicsLayer->setContentsToImage(opaqueImage.get()); |
133 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); | 133 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); |
134 | 134 |
135 graphicsLayer->setContentsToImage(nonOpaqueImage.get()); | 135 graphicsLayer->setContentsToImage(nonOpaqueImage.get()); |
136 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); | 136 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); |
137 } | 137 } |
138 | 138 |
139 } // namespace blink | 139 } // namespace blink |
OLD | NEW |