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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc

Issue 2818993002: GL Implementation for GPU Discardable
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 2187f4961f84c9aeb6d366bfcf033b22f6d34dcb..4792f3b1f55ac40863600c5b74308cf660951b76 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -21,6 +21,7 @@
#include "gpu/command_buffer/service/logger.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/program_manager.h"
+#include "gpu/command_buffer/service/service_discardable_manager.h"
#include "gpu/command_buffer/service/test_helper.h"
#include "gpu/command_buffer/service/vertex_attrib_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -193,12 +194,12 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
feature_info = new FeatureInfo(*command_line, gpu_driver_bug_workaround);
}
- group_ = scoped_refptr<ContextGroup>(
- new ContextGroup(gpu_preferences_, NULL, memory_tracker_,
- new ShaderTranslatorCache(gpu_preferences_),
- new FramebufferCompletenessCache, feature_info,
- normalized_init.bind_generates_resource, nullptr,
- nullptr, GpuFeatureInfo()));
+ group_ = scoped_refptr<ContextGroup>(new ContextGroup(
+ gpu_preferences_, NULL, memory_tracker_,
+ new ShaderTranslatorCache(gpu_preferences_),
+ new FramebufferCompletenessCache, feature_info,
+ normalized_init.bind_generates_resource, nullptr, nullptr,
+ GpuFeatureInfo(), new ServiceDiscardableManager));
bool use_default_textures = normalized_init.bind_generates_resource;
InSequence sequence;
@@ -2183,6 +2184,24 @@ void GLES2DecoderWithShaderTestBase::SetUp() {
SetupDefaultProgram();
}
+void GLES2DecoderTestBase::DoInitializeDiscardableTextureCHROMIUM(
+ GLuint texture_id) {
+ scoped_refptr<gpu::Buffer> buffer =
+ engine_->GetSharedMemoryBuffer(kSharedMemoryId);
+ ClientDiscardableHandle handle(buffer, 0, kSharedMemoryId);
+
+ cmds::InitializeDiscardableTextureCHROMIUM cmd;
+ cmd.Init(texture_id, kSharedMemoryId, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+}
+
+void GLES2DecoderTestBase::DoUnlockDiscardableTextureCHROMIUM(
+ GLuint texture_id) {
+ cmds::UnlockDiscardableTextureCHROMIUM cmd;
+ cmd.Init(texture_id);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.

Powered by Google App Engine
This is Rietveld 408576698