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

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

Issue 476683002: Cleanup namespace usage in platform/graphics/[G-S]* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return nullptr; 81 return nullptr;
82 82
83 return m_nativeImage; 83 return m_nativeImage;
84 } 84 }
85 85
86 // Stub implementations of pure virtual Image functions. 86 // Stub implementations of pure virtual Image functions.
87 virtual void destroyDecodedData(bool) OVERRIDE 87 virtual void destroyDecodedData(bool) OVERRIDE
88 { 88 {
89 } 89 }
90 90
91 virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, Comp ositeOperator, blink::WebBlendMode) OVERRIDE 91 virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, Comp ositeOperator, WebBlendMode) OVERRIDE
92 { 92 {
93 } 93 }
94 94
95 private: 95 private:
96 96
97 IntSize m_size; 97 IntSize m_size;
98 98
99 RefPtr<NativeImageSkia> m_nativeImage; 99 RefPtr<NativeImageSkia> m_nativeImage;
100 }; 100 };
101 101
102 class GraphicsLayerForTesting : public GraphicsLayer { 102 class GraphicsLayerForTesting : public GraphicsLayer {
103 public: 103 public:
104 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) 104 explicit GraphicsLayerForTesting(GraphicsLayerClient* client)
105 : GraphicsLayer(client) { }; 105 : GraphicsLayer(client) { };
106 106
107 virtual blink::WebLayer* contentsLayer() const { return GraphicsLayer::conte ntsLayer(); } 107 virtual WebLayer* contentsLayer() const { return GraphicsLayer::contentsLaye r(); }
108 }; 108 };
109 109
110 TEST(ImageLayerChromiumTest, opaqueImages) 110 TEST(ImageLayerChromiumTest, opaqueImages)
111 { 111 {
112 MockGraphicsLayerClient client; 112 MockGraphicsLayerClient client;
113 OwnPtr<GraphicsLayerForTesting> graphicsLayer = adoptPtr(new GraphicsLayerFo rTesting(&client)); 113 OwnPtr<GraphicsLayerForTesting> graphicsLayer = adoptPtr(new GraphicsLayerFo rTesting(&client));
114 ASSERT_TRUE(graphicsLayer.get()); 114 ASSERT_TRUE(graphicsLayer.get());
115 115
116 RefPtr<Image> opaqueImage = TestImage::create(IntSize(100, 100), true /* opa que */); 116 RefPtr<Image> opaqueImage = TestImage::create(IntSize(100, 100), true /* opa que */);
117 ASSERT_TRUE(opaqueImage.get()); 117 ASSERT_TRUE(opaqueImage.get());
118 RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), false /* opaque */); 118 RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), false /* opaque */);
119 ASSERT_TRUE(nonOpaqueImage.get()); 119 ASSERT_TRUE(nonOpaqueImage.get());
120 120
121 ASSERT_FALSE(graphicsLayer->contentsLayer()); 121 ASSERT_FALSE(graphicsLayer->contentsLayer());
122 122
123 graphicsLayer->setContentsToImage(opaqueImage.get()); 123 graphicsLayer->setContentsToImage(opaqueImage.get());
124 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); 124 ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque());
125 125
126 graphicsLayer->setContentsToImage(nonOpaqueImage.get()); 126 graphicsLayer->setContentsToImage(nonOpaqueImage.get());
127 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); 127 ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque());
128 } 128 }
129 129
130 } // namespace 130 } // namespace
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageFrameGeneratorTest.cpp ('k') | Source/platform/graphics/ImageObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698