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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp

Issue 1857543002: Don't recreate SkImages for high-res (GIF, WEBP...) animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review #4 fix. Thanks @pkasting. Created 4 years, 8 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
OLDNEW
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
56 IntSize size() const override 56 IntSize size() const override
57 { 57 {
58 return m_size; 58 return m_size;
59 } 59 }
60 60
61 PassRefPtr<SkImage> imageForCurrentFrame() override 61 PassRefPtr<SkImage> imageForCurrentFrame() override
62 { 62 {
63 return m_image; 63 return m_image;
64 } 64 }
65 65
66 void destroyDecodedData(bool) override 66 void destroyDecodedData() override
67 { 67 {
68 // Image pure virtual stub. 68 // Image pure virtual stub.
69 } 69 }
70 70
71 void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, Res pectImageOrientationEnum, ImageClampingMode) override 71 void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, Res pectImageOrientationEnum, ImageClampingMode) override
72 { 72 {
73 // Image pure virtual stub. 73 // Image pure virtual stub.
74 } 74 }
75 75
76 private: 76 private:
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 ASSERT_FALSE(graphicsLayer->contentsLayer()); 142 ASSERT_FALSE(graphicsLayer->contentsLayer());
143 143
144 graphicsLayer->setContentsToImage(opaqueImage.get()); 144 graphicsLayer->setContentsToImage(opaqueImage.get());
145 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); 145 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque());
146 146
147 graphicsLayer->setContentsToImage(nonOpaqueImage.get()); 147 graphicsLayer->setContentsToImage(nonOpaqueImage.get());
148 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); 148 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque());
149 } 149 }
150 150
151 } // namespace blink 151 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698