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

Side by Side Diff: cc/layers/texture_layer_impl_unittest.cc

Issue 1968363002: SurfaceAggregator should check whether output is secure when drawin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « cc/layers/texture_layer_impl.cc ('k') | cc/layers/ui_resource_layer_impl.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/layers/texture_layer_impl.h" 5 #include "cc/layers/texture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/output/context_provider.h" 9 #include "cc/output/context_provider.h"
10 #include "cc/output/output_surface.h" 10 #include "cc/output/output_surface.h"
11 #include "cc/quads/draw_quad.h" 11 #include "cc/quads/draw_quad.h"
12 #include "cc/quads/texture_draw_quad.h"
12 #include "cc/test/layer_test_common.h" 13 #include "cc/test/layer_test_common.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace cc { 16 namespace cc {
16 namespace { 17 namespace {
17 18
18 void IgnoreCallback(const gpu::SyncToken& sync_token, 19 void IgnoreCallback(const gpu::SyncToken& sync_token,
19 bool lost, 20 bool lost,
20 BlockingTaskRunner* main_thread_task_runner) {} 21 BlockingTaskRunner* main_thread_task_runner) {}
21 22
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 texture_mailbox, 127 texture_mailbox,
127 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback))); 128 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback)));
128 129
129 impl.CalcDrawProps(viewport_size); 130 impl.CalcDrawProps(viewport_size);
130 131
131 { 132 {
132 gfx::Rect occluded; 133 gfx::Rect occluded;
133 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded); 134 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded);
134 135
135 EXPECT_EQ(1u, impl.quad_list().size()); 136 EXPECT_EQ(1u, impl.quad_list().size());
136 EXPECT_EQ(DrawQuad::Material::SOLID_COLOR, 137 ASSERT_EQ(DrawQuad::Material::TEXTURE_CONTENT,
137 impl.quad_list().front()->material); 138 impl.quad_list().front()->material);
138 } 139 const TextureDrawQuad* quad =
139 140 TextureDrawQuad::MaterialCast(impl.quad_list().front());
140 { 141 EXPECT_TRUE(quad->secure_output_only);
141 impl.SetOutputIsSecure(true);
142 gfx::Rect occluded;
143 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded);
144
145 EXPECT_EQ(1u, impl.quad_list().size());
146 EXPECT_NE(DrawQuad::Material::SOLID_COLOR,
147 impl.quad_list().front()->material);
148 }
149
150 {
151 impl.SetOutputIsSecure(false);
152 impl.RequestCopyOfOutput();
153 gfx::Rect occluded;
154 impl.AppendQuadsWithOcclusion(texture_layer_impl, occluded);
155
156 EXPECT_EQ(1u, impl.quad_list().size());
157 EXPECT_EQ(DrawQuad::Material::SOLID_COLOR,
158 impl.quad_list().front()->material);
159 } 142 }
160 } 143 }
161 144
162 } // namespace 145 } // namespace
163 } // namespace cc 146 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_impl.cc ('k') | cc/layers/ui_resource_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698