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

Side by Side Diff: cc/output/renderer_pixeltest.cc

Issue 460563003: Fix interchange of red and blue content when using rgba_4444_textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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
« no previous file with comments | « AUTHORS ('k') | cc/resources/platform_color.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 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "cc/layers/append_quads_data.h" 6 #include "cc/layers/append_quads_data.h"
7 #include "cc/output/gl_renderer.h" 7 #include "cc/output/gl_renderer.h"
8 #include "cc/quads/draw_quad.h" 8 #include "cc/quads/draw_quad.h"
9 #include "cc/quads/picture_draw_quad.h" 9 #include "cc/quads/picture_draw_quad.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 2115
2116 RenderPassList pass_list; 2116 RenderPassList pass_list;
2117 pass_list.push_back(pass.Pass()); 2117 pass_list.push_back(pass.Pass());
2118 2118
2119 EXPECT_TRUE(this->RunPixelTest( 2119 EXPECT_TRUE(this->RunPixelTest(
2120 &pass_list, 2120 &pass_list,
2121 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), 2121 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")),
2122 ExactPixelComparator(true))); 2122 ExactPixelComparator(true)));
2123 } 2123 }
2124 2124
2125 TEST_F(GLRendererPixelTest, PictureDrawQuadTexture4444) {
USE eero AT chromium.org 2014/08/11 14:28:40 Done.
2126 gfx::Size pile_tile_size(1000, 1000);
2127 gfx::Rect viewport(this->device_viewport_size_);
2128 ResourceFormat texture_format = RGBA_4444;
USE eero AT chromium.org 2014/08/11 14:28:40 No idea. I did not find any relevant function to b
enne (OOO) 2014/08/11 19:59:37 Really the question is if Mesa supports this. I a
USE eero AT chromium.org 2014/08/12 09:26:11 Unit tests seem to be using osmesa GL implementati
2129
2130 RenderPass::Id id(1, 1);
2131 gfx::Transform transform_to_root;
2132 scoped_ptr<RenderPass> pass =
2133 CreateTestRenderPass(id, viewport, transform_to_root);
2134
2135 // One viewport-filling blue quad
2136 scoped_refptr<FakePicturePileImpl> blue_pile =
2137 FakePicturePileImpl::CreateFilledPile(pile_tile_size, viewport.size());
2138 SkPaint blue_paint;
2139 blue_paint.setColor(SK_ColorBLUE);
2140 blue_pile->add_draw_rect_with_paint(viewport, blue_paint);
2141 blue_pile->RerecordPile();
2142
2143 gfx::Transform blue_content_to_target_transform;
2144 SharedQuadState* blue_shared_state = CreateTestSharedQuadState(
2145 blue_content_to_target_transform, viewport, pass.get());
2146
2147 PictureDrawQuad* blue_quad = pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
2148 blue_quad->SetNew(blue_shared_state,
2149 viewport,
2150 gfx::Rect(),
2151 viewport,
2152 gfx::RectF(0.f, 0.f, 1.f, 1.f),
2153 viewport.size(),
2154 texture_format,
2155 viewport,
2156 1.f,
2157 PicturePileImpl::CreateFromOther(blue_pile));
2158
2159 RenderPassList pass_list;
2160 pass_list.push_back(pass.Pass());
2161
2162 EXPECT_TRUE(this->RunPixelTest(&pass_list,
2163 base::FilePath(FILE_PATH_LITERAL("blue.png")),
2164 ExactPixelComparator(true)));
USE eero AT chromium.org 2014/08/11 14:28:40 Done. For that to work, I changed the blue compone
2165 }
2166
2125 TYPED_TEST(RendererPixelTest, WrapModeRepeat) { 2167 TYPED_TEST(RendererPixelTest, WrapModeRepeat) {
2126 gfx::Rect rect(this->device_viewport_size_); 2168 gfx::Rect rect(this->device_viewport_size_);
2127 2169
2128 RenderPass::Id id(1, 1); 2170 RenderPass::Id id(1, 1);
2129 scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); 2171 scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
2130 2172
2131 SharedQuadState* shared_state = 2173 SharedQuadState* shared_state =
2132 CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); 2174 CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
2133 2175
2134 gfx::Rect texture_rect(4, 4); 2176 gfx::Rect texture_rect(4, 4);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 EXPECT_TRUE(this->RunPixelTest( 2223 EXPECT_TRUE(this->RunPixelTest(
2182 &pass_list, 2224 &pass_list,
2183 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), 2225 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")),
2184 FuzzyPixelOffByOneComparator(true))); 2226 FuzzyPixelOffByOneComparator(true)));
2185 } 2227 }
2186 2228
2187 #endif // !defined(OS_ANDROID) 2229 #endif // !defined(OS_ANDROID)
2188 2230
2189 } // namespace 2231 } // namespace
2190 } // namespace cc 2232 } // namespace cc
OLDNEW
« no previous file with comments | « AUTHORS ('k') | cc/resources/platform_color.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698