summaryrefslogtreecommitdiffstats
path: root/cc/layers/texture_layer_unittest.cc
diff options
context:
space:
mode:
authornkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 14:28:55 +0000
committernkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 14:28:55 +0000
commit986a5c89bb81fda1ab3eb5df2267514d014af723 (patch)
treee4f913d671f23815fa96c0ae8ea4a06c9421d825 /cc/layers/texture_layer_unittest.cc
parent1206675ede77d16f5e31d3b2f03be4cfaa8b677d (diff)
downloadchromium_src-986a5c89bb81fda1ab3eb5df2267514d014af723.zip
chromium_src-986a5c89bb81fda1ab3eb5df2267514d014af723.tar.gz
chromium_src-986a5c89bb81fda1ab3eb5df2267514d014af723.tar.bz2
Revert of Fix (or tag) uses of explicit '64' instead of GL_MAILBOX_SIZE_CHROMIUM (https://codereview.chromium.org/138763009/)
Reason for revert: FAILED: c++ -MMD -MF obj/cc/layers/cc_unittests.texture_layer_unittest.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_NSS=1 -DUSE_X11=1 -DOS_CHROMEOS=1 -DUSE_XI2_MT=2 -DIMAGE_LOADER_EXTENSION=1 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DUSE_UDEV -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_MANAGED_USERS=1 -DENABLE_MDNS=1 -DGTEST_HAS_POSIX_RE=0 -DGL_GLEXT_PROTOTYPES -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_ENABLE_INST_COUNT=0 -DSK_SUPPORT_GPU=1 '-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' -DSK_ENABLE_LEGACY_API_ALIASING=1 -DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1 -DSK_USE_POSIX_THREADS -DSK_DEFERRED_CANVAS_USES_FACTORIES=1 -DUNIT_TEST -DGTEST_HAS_RTTI=0 -DU_USING_ICU_NAMESPACE=0 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_FORTIFY_SOURCE=2 -I../../cc/test -I../../cc -I../.. -I../../third_party/khronos -I../../gpu -I../../skia/config -I../../third_party/skia/src/core -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../skia/ext -I../../testing/gmock/include -I../../testing/gtest/include -I../../third_party/icu/source/i18n -I../../third_party/icu/source/common -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -c ../../cc/layers/texture_layer_unittest.cc -o obj/cc/layers/cc_unittests.texture_layer_unittest.o In file included from ../../testing/gmock/include/gmock/gmock-spec-builders.h:71:0, from ../../testing/gmock/include/gmock/gmock-generated-function-mockers.h:43, from ../../testing/gmock/include/gmock/gmock.h:61, from ../../cc/layers/texture_layer_unittest.cc:33: ../../testing/gmock/include/gmock/gmock-matchers.h: In member function 'bool testing::internal::EqMatcher<Rhs>::Impl<Lhs>::MatchAndExplain(Lhs, testing::MatchResultListener*) const [with Lhs = const gpu::Mailbox&, Rhs = gpu::Mailbox]': ../../cc/layers/texture_layer_unittest.cc:2173:1: instantiated from here ../../testing/gmock/include/gmock/gmock-matchers.h:784:1: error: no match for 'operator==' in 'lhs == ((const testing::internal::EqMatcher<gpu::Mailbox>::Impl<const gpu::Mailbox&>*)this)->testing::internal::EqMatcher<gpu::Mailbox>::Impl<const gpu::Mailbox&>::rhs_' ../../testing/gmock/include/gmock/gmock-matchers.h:784:1: note: candidate is: ../../testing/gtest/include/gtest/internal/gtest-linked_ptr.h:213:6: note: template<class T> bool testing::internal::operator==(T*, const testing::internal::linked_ptr<T>&) ../../testing/gmock/include/gmock/gmock-matchers.h:784:1: error: control reaches end of non-void function [-Werror=return-type] Original issue's description: > Fix (or tag) uses of explicit '64' instead of GL_MAILBOX_SIZE_CHROMIUM > > That way we can easily change the size later. Security says 64 may be overkill. > > BUG=None > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251306 TBR=danakj@chromium.org,piman@chromium.org NOTREECHECKS=true NOTRY=true BUG=None Review URL: https://codereview.chromium.org/166853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/texture_layer_unittest.cc')
-rw-r--r--cc/layers/texture_layer_unittest.cc41
1 files changed, 25 insertions, 16 deletions
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index 88ff040..cfbe813 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -41,9 +41,9 @@ using ::testing::AnyNumber;
namespace cc {
namespace {
-gpu::Mailbox MailboxFromChar(char value) {
+gpu::Mailbox MailboxFromString(const std::string& string) {
gpu::Mailbox mailbox;
- memset(mailbox.name, value, sizeof(mailbox.name));
+ mailbox.SetName(reinterpret_cast<const int8*>(string.data()));
return mailbox;
}
@@ -322,7 +322,7 @@ TEST_F(TextureLayerTest, RateLimiter) {
class MockMailboxCallback {
public:
MOCK_METHOD3(Release,
- void(const gpu::Mailbox& mailbox,
+ void(const std::string& mailbox,
uint32 sync_point,
bool lost_resource));
MOCK_METHOD3(Release2,
@@ -333,8 +333,8 @@ class MockMailboxCallback {
struct CommonMailboxObjects {
CommonMailboxObjects()
- : mailbox_name1_(MailboxFromChar('1')),
- mailbox_name2_(MailboxFromChar('2')),
+ : mailbox_name1_(64, '1'),
+ mailbox_name2_(64, '2'),
sync_point1_(1),
sync_point2_(2),
shared_memory_(new base::SharedMemory) {
@@ -346,8 +346,10 @@ struct CommonMailboxObjects {
mailbox_name2_);
const uint32 arbitrary_target1 = 1;
const uint32 arbitrary_target2 = 2;
- mailbox1_ = TextureMailbox(mailbox_name1_, arbitrary_target1, sync_point1_);
- mailbox2_ = TextureMailbox(mailbox_name2_, arbitrary_target2, sync_point2_);
+ mailbox1_ = TextureMailbox(
+ MailboxFromString(mailbox_name1_), arbitrary_target1, sync_point1_);
+ mailbox2_ = TextureMailbox(
+ MailboxFromString(mailbox_name2_), arbitrary_target2, sync_point2_);
gfx::Size size(128, 128);
EXPECT_TRUE(shared_memory_->CreateAndMapAnonymous(4 * size.GetArea()));
release_mailbox3_ = base::Bind(&MockMailboxCallback::Release2,
@@ -356,8 +358,8 @@ struct CommonMailboxObjects {
mailbox3_ = TextureMailbox(shared_memory_.get(), size);
}
- gpu::Mailbox mailbox_name1_;
- gpu::Mailbox mailbox_name2_;
+ std::string mailbox_name1_;
+ std::string mailbox_name2_;
MockMailboxCallback mock_callback_;
ReleaseCallback release_mailbox1_;
ReleaseCallback release_mailbox2_;
@@ -772,7 +774,8 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
&TextureLayerImplWithMailboxThreadedCallback::ReleaseCallback,
base::Unretained(this)));
layer_->SetTextureMailbox(
- TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
+ TextureMailbox(
+ MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
callback.Pass());
}
@@ -990,7 +993,8 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest {
base::Bind(
&TextureLayerMailboxIsActivatedDuringCommit::ReleaseCallback));
layer_->SetTextureMailbox(
- TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
+ TextureMailbox(
+ MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
callback.Pass());
}
@@ -1636,7 +1640,8 @@ class TextureLayerNoExtraCommitForMailboxTest
return true;
}
- *texture_mailbox = TextureMailbox(MailboxFromChar('1'), GL_TEXTURE_2D, 0);
+ *texture_mailbox = TextureMailbox(
+ MailboxFromString(std::string(64, '1')), GL_TEXTURE_2D, 0);
*release_callback = SingleReleaseCallback::Create(
base::Bind(&TextureLayerNoExtraCommitForMailboxTest::MailboxReleased,
base::Unretained(this)));
@@ -1747,7 +1752,8 @@ class TextureLayerChangeInvisibleMailboxTest
}
TextureMailbox MakeMailbox(char name) {
- return TextureMailbox(MailboxFromChar(name), GL_TEXTURE_2D, 0);
+ return TextureMailbox(
+ MailboxFromString(std::string(64, name)), GL_TEXTURE_2D, 0);
}
void MailboxReleased(uint32 sync_point, bool lost_resource) {
@@ -1880,7 +1886,8 @@ class TextureLayerReleaseResourcesBase
TextureMailbox* mailbox,
scoped_ptr<SingleReleaseCallback>* release_callback,
bool use_shared_memory) OVERRIDE {
- *mailbox = TextureMailbox(MailboxFromChar('1'), GL_TEXTURE_2D, 0);
+ *mailbox = TextureMailbox(
+ MailboxFromString(std::string(64, '1')), GL_TEXTURE_2D, 0);
*release_callback = SingleReleaseCallback::Create(
base::Bind(&TextureLayerReleaseResourcesBase::MailboxReleased,
base::Unretained(this)));
@@ -2036,7 +2043,8 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest {
&TextureLayerWithMailboxMainThreadDeleted::ReleaseCallback,
base::Unretained(this)));
layer_->SetTextureMailbox(
- TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
+ TextureMailbox(
+ MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
callback.Pass());
}
@@ -2109,7 +2117,8 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest {
&TextureLayerWithMailboxImplThreadDeleted::ReleaseCallback,
base::Unretained(this)));
layer_->SetTextureMailbox(
- TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
+ TextureMailbox(
+ MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
callback.Pass());
}