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

Unified Diff: gpu/ipc/service/stream_texture_android.cc

Issue 1845563005: Refactor content/common/gpu into gpu/ipc/service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Privatize gpu/command_buffer/service dep on gpu/command_buffer/common:common_sources Created 4 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/ipc/service/stream_texture_android.cc
diff --git a/content/common/gpu/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
similarity index 95%
rename from content/common/gpu/stream_texture_android.cc
rename to gpu/ipc/service/stream_texture_android.cc
index ae135d32d58d9c9d1c7a7a9069e2d878bd847b3a..68198681b281a3f07271c32ae1613aa6c0dbe814 100644
--- a/content/common/gpu/stream_texture_android.cc
+++ b/gpu/ipc/service/stream_texture_android.cc
@@ -2,31 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/gpu/stream_texture_android.h"
+#include "gpu/ipc/service/stream_texture_android.h"
#include <string.h>
#include "base/bind.h"
#include "base/strings/stringize_macros.h"
-#include "content/common/gpu/gpu_channel.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/context_state.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/ipc/common/android/surface_texture_peer.h"
#include "gpu/ipc/common/gpu_messages.h"
+#include "gpu/ipc/service/gpu_channel.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_helper.h"
#include "ui/gl/scoped_binders.h"
#include "ui/gl/scoped_make_current.h"
-namespace content {
+namespace gpu {
-using gpu::gles2::ContextGroup;
-using gpu::gles2::GLES2Decoder;
-using gpu::gles2::TextureManager;
-using gpu::gles2::TextureRef;
+using gles2::ContextGroup;
+using gles2::GLES2Decoder;
+using gles2::TextureManager;
+using gles2::TextureRef;
// static
bool StreamTexture::Create(GpuCommandBufferStub* owner_stub,
@@ -51,7 +51,7 @@ bool StreamTexture::Create(GpuCommandBufferStub* owner_stub,
GL_UNSIGNED_BYTE, gfx::Rect(size));
texture_manager->SetLevelImage(texture, GL_TEXTURE_EXTERNAL_OES, 0,
gl_image.get(),
- gpu::gles2::Texture::UNBOUND);
+ gles2::Texture::UNBOUND);
return true;
}
@@ -164,9 +164,9 @@ void StreamTexture::UpdateTexImage() {
// The cmd decoder takes care of restoring the binding for this GLImage as
// far as the current context is concerned, but if we temporarily change
// it, we have to keep the state intact in *that* context also.
- const gpu::gles2::ContextState* state =
+ const gles2::ContextState* state =
owner_stub_->decoder()->GetContextState();
- const gpu::gles2::TextureUnit& active_unit =
+ const gles2::TextureUnit& active_unit =
state->texture_units[state->active_texture_unit];
glBindTexture(GL_TEXTURE_EXTERNAL_OES,
active_unit.bound_texture_external_oes.get()
@@ -203,14 +203,14 @@ bool StreamTexture::CopyTexImage(unsigned target) {
TextureManager* texture_manager =
owner_stub_->decoder()->GetContextGroup()->texture_manager();
- gpu::gles2::Texture* texture =
+ gles2::Texture* texture =
texture_manager->GetTextureForServiceId(texture_id_);
if (texture) {
// By setting image state to UNBOUND instead of COPIED we ensure that
// CopyTexImage() is called each time the surface texture is used for
// drawing.
texture->SetLevelImage(GL_TEXTURE_EXTERNAL_OES, 0, this,
- gpu::gles2::Texture::UNBOUND);
+ gles2::Texture::UNBOUND);
}
return true;
@@ -256,7 +256,7 @@ void StreamTexture::OnEstablishPeer(int32_t primary_id, int32_t secondary_id) {
base::ProcessHandle process = owner_stub_->channel()->GetClientPID();
- gpu::SurfaceTexturePeer::GetInstance()->EstablishSurfaceTexturePeer(
+ SurfaceTexturePeer::GetInstance()->EstablishSurfaceTexturePeer(
process, surface_texture_, primary_id, secondary_id);
}
@@ -377,4 +377,4 @@ void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
// TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914
}
-} // namespace content
+} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698