| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 void destroyDecodedData() override { | 57 void destroyDecodedData() override { |
| 58 // Image pure virtual stub. | 58 // Image pure virtual stub. |
| 59 } | 59 } |
| 60 | 60 |
| 61 void draw(PaintCanvas*, | 61 void draw(PaintCanvas*, |
| 62 const PaintFlags&, | 62 const PaintFlags&, |
| 63 const FloatRect&, | 63 const FloatRect&, |
| 64 const FloatRect&, | 64 const FloatRect&, |
| 65 RespectImageOrientationEnum, | 65 RespectImageOrientationEnum, |
| 66 ImageClampingMode, | 66 ImageClampingMode) override { |
| 67 const ColorBehavior&) override { | |
| 68 // Image pure virtual stub. | 67 // Image pure virtual stub. |
| 69 } | 68 } |
| 70 | 69 |
| 71 private: | 70 private: |
| 72 TestImage(IntSize size, bool opaque) : Image(0), m_size(size) { | 71 TestImage(IntSize size, bool opaque) : Image(0), m_size(size) { |
| 73 sk_sp<SkSurface> surface = createSkSurface(size, opaque); | 72 sk_sp<SkSurface> surface = createSkSurface(size, opaque); |
| 74 if (!surface) | 73 if (!surface) |
| 75 return; | 74 return; |
| 76 | 75 |
| 77 surface->getCanvas()->clear(SK_ColorTRANSPARENT); | 76 surface->getCanvas()->clear(SK_ColorTRANSPARENT); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ASSERT_FALSE(graphicsLayer->contentsLayer()); | 126 ASSERT_FALSE(graphicsLayer->contentsLayer()); |
| 128 | 127 |
| 129 graphicsLayer->setContentsToImage(opaqueImage.get()); | 128 graphicsLayer->setContentsToImage(opaqueImage.get()); |
| 130 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); | 129 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); |
| 131 | 130 |
| 132 graphicsLayer->setContentsToImage(nonOpaqueImage.get()); | 131 graphicsLayer->setContentsToImage(nonOpaqueImage.get()); |
| 133 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); | 132 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); |
| 134 } | 133 } |
| 135 | 134 |
| 136 } // namespace blink | 135 } // namespace blink |
| OLD | NEW |