| Index: gpu/ipc/service/gpu_command_buffer_stub.cc
|
| diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
|
| similarity index 88%
|
| rename from content/common/gpu/gpu_command_buffer_stub.cc
|
| rename to gpu/ipc/service/gpu_command_buffer_stub.cc
|
| index ea4d94421296975355842dd5016541324907648a..f3963934e509d9094584f0cd5ac302ddd3f96dd5 100644
|
| --- a/content/common/gpu/gpu_command_buffer_stub.cc
|
| +++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/common/gpu/gpu_command_buffer_stub.h"
|
| +#include "gpu/ipc/service/gpu_command_buffer_stub.h"
|
|
|
| #include <utility>
|
|
|
| @@ -15,13 +15,6 @@
|
| #include "base/time/time.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "build/build_config.h"
|
| -#include "content/common/gpu/gpu_channel.h"
|
| -#include "content/common/gpu/gpu_channel_manager.h"
|
| -#include "content/common/gpu/gpu_channel_manager_delegate.h"
|
| -#include "content/common/gpu/gpu_memory_manager.h"
|
| -#include "content/common/gpu/gpu_memory_tracking.h"
|
| -#include "content/common/gpu/gpu_watchdog.h"
|
| -#include "content/common/gpu/image_transport_surface.h"
|
| #include "gpu/command_buffer/common/constants.h"
|
| #include "gpu/command_buffer/common/mailbox.h"
|
| #include "gpu/command_buffer/common/sync_token.h"
|
| @@ -37,6 +30,13 @@
|
| #include "gpu/command_buffer/service/transfer_buffer_manager.h"
|
| #include "gpu/command_buffer/service/valuebuffer_manager.h"
|
| #include "gpu/ipc/common/gpu_messages.h"
|
| +#include "gpu/ipc/service/gpu_channel.h"
|
| +#include "gpu/ipc/service/gpu_channel_manager.h"
|
| +#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
|
| +#include "gpu/ipc/service/gpu_memory_manager.h"
|
| +#include "gpu/ipc/service/gpu_memory_tracking.h"
|
| +#include "gpu/ipc/service/gpu_watchdog.h"
|
| +#include "gpu/ipc/service/image_transport_surface.h"
|
| #include "ui/gl/gl_bindings.h"
|
| #include "ui/gl/gl_image.h"
|
| #include "ui/gl/gl_switches.h"
|
| @@ -46,10 +46,10 @@
|
| #endif
|
|
|
| #if defined(OS_ANDROID)
|
| -#include "content/common/gpu/stream_texture_android.h"
|
| +#include "gpu/ipc/service/stream_texture_android.h"
|
| #endif
|
|
|
| -namespace content {
|
| +namespace gpu {
|
| struct WaitForCommandState {
|
| WaitForCommandState(int32_t start, int32_t end, IPC::Message* reply)
|
| : start(start), end(end), reply(reply) {}
|
| @@ -63,7 +63,7 @@ namespace {
|
|
|
| // The GpuCommandBufferMemoryTracker class provides a bridge between the
|
| // ContextGroup's memory type managers and the GpuMemoryManager class.
|
| -class GpuCommandBufferMemoryTracker : public gpu::gles2::MemoryTracker {
|
| +class GpuCommandBufferMemoryTracker : public gles2::MemoryTracker {
|
| public:
|
| explicit GpuCommandBufferMemoryTracker(GpuChannel* channel,
|
| uint64_t share_group_tracing_guid)
|
| @@ -154,8 +154,8 @@ DevToolsChannelData::CreateForChannel(GpuChannel* channel) {
|
| return make_scoped_ptr(new DevToolsChannelData(res.release()));
|
| }
|
|
|
| -gpu::CommandBufferId GetCommandBufferID(int channel_id, int32_t route_id) {
|
| - return gpu::CommandBufferId::FromUnsafeValue(
|
| +CommandBufferId GetCommandBufferID(int channel_id, int32_t route_id) {
|
| + return CommandBufferId::FromUnsafeValue(
|
| (static_cast<uint64_t>(channel_id) << 32) | route_id);
|
| }
|
|
|
| @@ -163,16 +163,16 @@ gpu::CommandBufferId GetCommandBufferID(int channel_id, int32_t route_id) {
|
|
|
| GpuCommandBufferStub::GpuCommandBufferStub(
|
| GpuChannel* channel,
|
| - gpu::SyncPointManager* sync_point_manager,
|
| + SyncPointManager* sync_point_manager,
|
| base::SingleThreadTaskRunner* task_runner,
|
| GpuCommandBufferStub* share_group,
|
| - gpu::SurfaceHandle surface_handle,
|
| - gpu::gles2::MailboxManager* mailbox_manager,
|
| - gpu::PreemptionFlag* preempt_by_flag,
|
| - gpu::gles2::SubscriptionRefSet* subscription_ref_set,
|
| - gpu::ValueStateMap* pending_valuebuffer_state,
|
| + SurfaceHandle surface_handle,
|
| + gles2::MailboxManager* mailbox_manager,
|
| + PreemptionFlag* preempt_by_flag,
|
| + gles2::SubscriptionRefSet* subscription_ref_set,
|
| + ValueStateMap* pending_valuebuffer_state,
|
| const gfx::Size& size,
|
| - const gpu::gles2::DisallowedFeatures& disallowed_features,
|
| + const gles2::DisallowedFeatures& disallowed_features,
|
| const std::vector<int32_t>& attribs,
|
| gfx::GpuPreference gpu_preference,
|
| int32_t stream_id,
|
| @@ -202,7 +202,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
|
| active_url_hash_ = base::Hash(active_url.possibly_invalid_spec());
|
| FastSetActiveURL(active_url_, active_url_hash_, channel_);
|
|
|
| - gpu::gles2::ContextCreationAttribHelper attrib_parser;
|
| + gles2::ContextCreationAttribHelper attrib_parser;
|
| attrib_parser.Parse(requested_attribs_);
|
|
|
| if (share_group) {
|
| @@ -210,7 +210,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
|
| DCHECK(context_group_->bind_generates_resource() ==
|
| attrib_parser.bind_generates_resource);
|
| } else {
|
| - context_group_ = new gpu::gles2::ContextGroup(
|
| + context_group_ = new gles2::ContextGroup(
|
| channel_->gpu_channel_manager()->gpu_preferences(), mailbox_manager,
|
| new GpuCommandBufferMemoryTracker(channel,
|
| command_buffer_id_.GetUnsafeValue()),
|
| @@ -243,12 +243,12 @@ GpuCommandBufferStub::GpuCommandBufferStub(
|
| surface_format_ = gfx::GLSurface::SURFACE_RGB565;
|
| gfx::GLSurface* defaultOffscreenSurface =
|
| channel_->gpu_channel_manager()->GetDefaultOffscreenSurface();
|
| - bool is_onscreen = (surface_handle_ != gpu::kNullSurfaceHandle);
|
| + bool is_onscreen = (surface_handle_ != kNullSurfaceHandle);
|
| if (surface_format_ != defaultOffscreenSurface->GetFormat() && is_onscreen)
|
| use_virtualized_gl_context_ = false;
|
| #endif
|
|
|
| - if ((surface_handle_ == gpu::kNullSurfaceHandle) && initial_size_.IsEmpty()) {
|
| + if ((surface_handle_ == kNullSurfaceHandle) && initial_size_.IsEmpty()) {
|
| // If we're an offscreen surface with zero width and/or height, set to a
|
| // non-zero size so that we have a complete framebuffer for operations like
|
| // glClear.
|
| @@ -391,9 +391,9 @@ void GpuCommandBufferStub::PerformWork() {
|
|
|
| bool GpuCommandBufferStub::HasUnprocessedCommands() {
|
| if (command_buffer_) {
|
| - gpu::CommandBuffer::State state = command_buffer_->GetLastState();
|
| + CommandBuffer::State state = command_buffer_->GetLastState();
|
| return command_buffer_->GetPutOffset() != state.get_offset &&
|
| - !gpu::error::IsError(state.error);
|
| + !error::IsError(state.error);
|
| }
|
| return false;
|
| }
|
| @@ -443,7 +443,7 @@ bool GpuCommandBufferStub::MakeCurrent() {
|
| return true;
|
| DLOG(ERROR) << "Context lost because MakeCurrent failed.";
|
| command_buffer_->SetContextLostReason(decoder_->GetContextLostReason());
|
| - command_buffer_->SetParseError(gpu::error::kLostContext);
|
| + command_buffer_->SetParseError(error::kLostContext);
|
| CheckContextLost();
|
| return false;
|
| }
|
| @@ -460,7 +460,7 @@ void GpuCommandBufferStub::Destroy() {
|
|
|
| if (initialized_) {
|
| GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
|
| - if ((surface_handle_ == gpu::kNullSurfaceHandle) && !active_url_.is_empty())
|
| + if ((surface_handle_ == kNullSurfaceHandle) && !active_url_.is_empty())
|
| gpu_channel_manager->delegate()->DidDestroyOffscreenContext(active_url_);
|
| }
|
|
|
| @@ -497,14 +497,14 @@ void GpuCommandBufferStub::Destroy() {
|
| void GpuCommandBufferStub::OnInitializeFailed(IPC::Message* reply_message) {
|
| Destroy();
|
| GpuCommandBufferMsg_Initialize::WriteReplyParams(
|
| - reply_message, false, gpu::Capabilities());
|
| + reply_message, false, Capabilities());
|
| Send(reply_message);
|
| }
|
|
|
| scoped_refptr<gfx::GLSurface> GpuCommandBufferStub::CreateSurface() {
|
| GpuChannelManager* manager = channel_->gpu_channel_manager();
|
| scoped_refptr<gfx::GLSurface> surface;
|
| - if (surface_handle_ != gpu::kNullSurfaceHandle) {
|
| + if (surface_handle_ != kNullSurfaceHandle) {
|
| surface = ImageTransportSurface::CreateNativeSurface(
|
| manager, this, surface_handle_, surface_format_);
|
| if (!surface || !surface->Initialize(surface_format_))
|
| @@ -524,7 +524,7 @@ void GpuCommandBufferStub::OnInitialize(
|
| scoped_ptr<base::SharedMemory> shared_state_shm(
|
| new base::SharedMemory(shared_state_handle, false));
|
|
|
| - command_buffer_.reset(new gpu::CommandBufferService(
|
| + command_buffer_.reset(new CommandBufferService(
|
| context_group_->transfer_buffer_manager()));
|
|
|
| bool result = command_buffer_->Initialize();
|
| @@ -533,12 +533,12 @@ void GpuCommandBufferStub::OnInitialize(
|
| GpuChannelManager* manager = channel_->gpu_channel_manager();
|
| DCHECK(manager);
|
|
|
| - decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get()));
|
| - executor_.reset(new gpu::CommandExecutor(command_buffer_.get(),
|
| + decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get()));
|
| + executor_.reset(new CommandExecutor(command_buffer_.get(),
|
| decoder_.get(), decoder_.get()));
|
| sync_point_client_ = sync_point_manager_->CreateSyncPointClient(
|
| channel_->GetSyncPointOrderData(stream_id_),
|
| - gpu::CommandBufferNamespace::GPU_IO, command_buffer_id_);
|
| + CommandBufferNamespace::GPU_IO, command_buffer_id_);
|
|
|
| if (preemption_flag_.get())
|
| executor_->SetPreemptByFlag(preemption_flag_);
|
| @@ -570,7 +570,7 @@ void GpuCommandBufferStub::OnInitialize(
|
| }
|
| // This should be a non-virtual GL context.
|
| DCHECK(context->GetHandle());
|
| - context = new gpu::GLContextVirtual(
|
| + context = new GLContextVirtual(
|
| share_group, context.get(), decoder_->AsWeakPtr());
|
| if (!context->Initialize(surface_.get(), gpu_preference_)) {
|
| // The real context created above for the default offscreen surface
|
| @@ -600,7 +600,7 @@ void GpuCommandBufferStub::OnInitialize(
|
|
|
| if (!context->GetGLStateRestorer()) {
|
| context->SetGLStateRestorer(
|
| - new gpu::GLStateRestorerImpl(decoder_->AsWeakPtr()));
|
| + new GLStateRestorerImpl(decoder_->AsWeakPtr()));
|
| }
|
|
|
| if (!context_group_->has_program_cache() &&
|
| @@ -610,7 +610,7 @@ void GpuCommandBufferStub::OnInitialize(
|
| }
|
|
|
| // Initialize the decoder with either the view or pbuffer GLContext.
|
| - bool offscreen = (surface_handle_ == gpu::kNullSurfaceHandle);
|
| + bool offscreen = (surface_handle_ == kNullSurfaceHandle);
|
| if (!decoder_->Initialize(surface_, context, offscreen, initial_size_,
|
| disallowed_features_, requested_attribs_)) {
|
| DLOG(ERROR) << "Failed to initialize decoder.";
|
| @@ -637,7 +637,7 @@ void GpuCommandBufferStub::OnInitialize(
|
| command_buffer_->SetPutOffsetChangeCallback(
|
| base::Bind(&GpuCommandBufferStub::PutChanged, base::Unretained(this)));
|
| command_buffer_->SetGetBufferChangeCallback(base::Bind(
|
| - &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get())));
|
| + &CommandExecutor::SetGetBuffer, base::Unretained(executor_.get())));
|
| command_buffer_->SetParseErrorCallback(
|
| base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this)));
|
| executor_->SetSchedulingChangedCallback(base::Bind(
|
| @@ -648,22 +648,22 @@ void GpuCommandBufferStub::OnInitialize(
|
| &GpuCommandBufferStub::OnCommandProcessed, base::Unretained(this)));
|
| }
|
|
|
| - const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState);
|
| + const size_t kSharedStateSize = sizeof(CommandBufferSharedState);
|
| if (!shared_state_shm->Map(kSharedStateSize)) {
|
| DLOG(ERROR) << "Failed to map shared state buffer.";
|
| OnInitializeFailed(reply_message);
|
| return;
|
| }
|
| - command_buffer_->SetSharedStateBuffer(gpu::MakeBackingFromSharedMemory(
|
| + command_buffer_->SetSharedStateBuffer(MakeBackingFromSharedMemory(
|
| std::move(shared_state_shm), kSharedStateSize));
|
|
|
| - gpu::Capabilities capabilities = decoder_->GetCapabilities();
|
| + Capabilities capabilities = decoder_->GetCapabilities();
|
|
|
| GpuCommandBufferMsg_Initialize::WriteReplyParams(
|
| reply_message, true, capabilities);
|
| Send(reply_message);
|
|
|
| - if ((surface_handle_ == gpu::kNullSurfaceHandle) && !active_url_.is_empty())
|
| + if ((surface_handle_ == kNullSurfaceHandle) && !active_url_.is_empty())
|
| manager->delegate()->DidCreateOffscreenContext(active_url_);
|
|
|
| initialized_ = true;
|
| @@ -704,7 +704,7 @@ void GpuCommandBufferStub::OnSetGetBuffer(int32_t shm_id,
|
| Send(reply_message);
|
| }
|
|
|
| -void GpuCommandBufferStub::OnProduceFrontBuffer(const gpu::Mailbox& mailbox) {
|
| +void GpuCommandBufferStub::OnProduceFrontBuffer(const Mailbox& mailbox) {
|
| TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnProduceFrontBuffer");
|
| if (!decoder_) {
|
| LOG(ERROR) << "Can't produce front buffer before initialization.";
|
| @@ -717,7 +717,7 @@ void GpuCommandBufferStub::OnProduceFrontBuffer(const gpu::Mailbox& mailbox) {
|
| void GpuCommandBufferStub::OnParseError() {
|
| TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
|
| DCHECK(command_buffer_.get());
|
| - gpu::CommandBuffer::State state = command_buffer_->GetLastState();
|
| + CommandBuffer::State state = command_buffer_->GetLastState();
|
| IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
|
| route_id_, state.context_lost_reason, state.error);
|
| msg->set_unblock(true);
|
| @@ -728,7 +728,7 @@ void GpuCommandBufferStub::OnParseError() {
|
| // blocked from automatically running.
|
| GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
|
| gpu_channel_manager->delegate()->DidLoseContext(
|
| - (surface_handle_ == gpu::kNullSurfaceHandle), state.context_lost_reason,
|
| + (surface_handle_ == kNullSurfaceHandle), state.context_lost_reason,
|
| active_url_);
|
|
|
| CheckContextLost();
|
| @@ -771,11 +771,11 @@ void GpuCommandBufferStub::OnWaitForGetOffsetInRange(
|
|
|
| void GpuCommandBufferStub::CheckCompleteWaits() {
|
| if (wait_for_token_ || wait_for_get_offset_) {
|
| - gpu::CommandBuffer::State state = command_buffer_->GetLastState();
|
| + CommandBuffer::State state = command_buffer_->GetLastState();
|
| if (wait_for_token_ &&
|
| - (gpu::CommandBuffer::InRange(
|
| + (CommandBuffer::InRange(
|
| wait_for_token_->start, wait_for_token_->end, state.token) ||
|
| - state.error != gpu::error::kNoError)) {
|
| + state.error != error::kNoError)) {
|
| ReportState();
|
| GpuCommandBufferMsg_WaitForTokenInRange::WriteReplyParams(
|
| wait_for_token_->reply.get(), state);
|
| @@ -783,10 +783,10 @@ void GpuCommandBufferStub::CheckCompleteWaits() {
|
| wait_for_token_.reset();
|
| }
|
| if (wait_for_get_offset_ &&
|
| - (gpu::CommandBuffer::InRange(wait_for_get_offset_->start,
|
| + (CommandBuffer::InRange(wait_for_get_offset_->start,
|
| wait_for_get_offset_->end,
|
| state.get_offset) ||
|
| - state.error != gpu::error::kNoError)) {
|
| + state.error != error::kNoError)) {
|
| ReportState();
|
| GpuCommandBufferMsg_WaitForGetOffsetInRange::WriteReplyParams(
|
| wait_for_get_offset_->reply.get(), state);
|
| @@ -817,9 +817,9 @@ void GpuCommandBufferStub::OnAsyncFlush(
|
| }
|
|
|
| last_flush_count_ = flush_count;
|
| - gpu::CommandBuffer::State pre_state = command_buffer_->GetLastState();
|
| + CommandBuffer::State pre_state = command_buffer_->GetLastState();
|
| command_buffer_->Flush(put_offset);
|
| - gpu::CommandBuffer::State post_state = command_buffer_->GetLastState();
|
| + CommandBuffer::State post_state = command_buffer_->GetLastState();
|
|
|
| if (pre_state.get_offset != post_state.get_offset)
|
| ReportState();
|
| @@ -847,7 +847,7 @@ void GpuCommandBufferStub::OnRegisterTransferBuffer(
|
|
|
| if (command_buffer_) {
|
| command_buffer_->RegisterTransferBuffer(
|
| - id, gpu::MakeBackingFromSharedMemory(std::move(shared_memory), size));
|
| + id, MakeBackingFromSharedMemory(std::move(shared_memory), size));
|
| }
|
| }
|
|
|
| @@ -871,20 +871,20 @@ void GpuCommandBufferStub::PutChanged() {
|
| }
|
|
|
| void GpuCommandBufferStub::PullTextureUpdates(
|
| - gpu::CommandBufferNamespace namespace_id,
|
| - gpu::CommandBufferId command_buffer_id,
|
| + CommandBufferNamespace namespace_id,
|
| + CommandBufferId command_buffer_id,
|
| uint32_t release) {
|
| - gpu::gles2::MailboxManager* mailbox_manager =
|
| + gles2::MailboxManager* mailbox_manager =
|
| context_group_->mailbox_manager();
|
| if (mailbox_manager->UsesSync() && MakeCurrent()) {
|
| - gpu::SyncToken sync_token(namespace_id, 0, command_buffer_id, release);
|
| + SyncToken sync_token(namespace_id, 0, command_buffer_id, release);
|
| mailbox_manager->PullTextureUpdates(sync_token);
|
| }
|
| }
|
|
|
| -void GpuCommandBufferStub::OnSignalSyncToken(const gpu::SyncToken& sync_token,
|
| +void GpuCommandBufferStub::OnSignalSyncToken(const SyncToken& sync_token,
|
| uint32_t id) {
|
| - scoped_refptr<gpu::SyncPointClientState> release_state =
|
| + scoped_refptr<SyncPointClientState> release_state =
|
| sync_point_manager_->GetSyncPointClientState(
|
| sync_token.namespace_id(), sync_token.command_buffer_id());
|
|
|
| @@ -903,9 +903,9 @@ void GpuCommandBufferStub::OnSignalAck(uint32_t id) {
|
|
|
| void GpuCommandBufferStub::OnSignalQuery(uint32_t query_id, uint32_t id) {
|
| if (decoder_) {
|
| - gpu::gles2::QueryManager* query_manager = decoder_->GetQueryManager();
|
| + gles2::QueryManager* query_manager = decoder_->GetQueryManager();
|
| if (query_manager) {
|
| - gpu::gles2::QueryManager::Query* query =
|
| + gles2::QueryManager::Query* query =
|
| query_manager->GetQuery(query_id);
|
| if (query) {
|
| query->AddCallback(
|
| @@ -926,10 +926,10 @@ void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) {
|
| return;
|
| }
|
|
|
| - gpu::gles2::MailboxManager* mailbox_manager =
|
| + gles2::MailboxManager* mailbox_manager =
|
| context_group_->mailbox_manager();
|
| if (mailbox_manager->UsesSync() && MakeCurrent()) {
|
| - gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0,
|
| + SyncToken sync_token(CommandBufferNamespace::GPU_IO, 0,
|
| command_buffer_id_, release);
|
| mailbox_manager->PushTextureUpdates(sync_token);
|
| }
|
| @@ -938,13 +938,13 @@ void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) {
|
| }
|
|
|
| bool GpuCommandBufferStub::OnWaitFenceSync(
|
| - gpu::CommandBufferNamespace namespace_id,
|
| - gpu::CommandBufferId command_buffer_id,
|
| + CommandBufferNamespace namespace_id,
|
| + CommandBufferId command_buffer_id,
|
| uint64_t release) {
|
| DCHECK(!waiting_for_sync_point_);
|
| DCHECK(executor_->scheduled());
|
|
|
| - scoped_refptr<gpu::SyncPointClientState> release_state =
|
| + scoped_refptr<SyncPointClientState> release_state =
|
| sync_point_manager_->GetSyncPointClientState(namespace_id,
|
| command_buffer_id);
|
|
|
| @@ -972,8 +972,8 @@ bool GpuCommandBufferStub::OnWaitFenceSync(
|
| }
|
|
|
| void GpuCommandBufferStub::OnWaitFenceSyncCompleted(
|
| - gpu::CommandBufferNamespace namespace_id,
|
| - gpu::CommandBufferId command_buffer_id,
|
| + CommandBufferNamespace namespace_id,
|
| + CommandBufferId command_buffer_id,
|
| uint64_t release) {
|
| DCHECK(waiting_for_sync_point_);
|
| TRACE_EVENT_ASYNC_END1("gpu", "WaitFenceSync", this, "GpuCommandBufferStub",
|
| @@ -996,26 +996,26 @@ void GpuCommandBufferStub::OnCreateImage(
|
| if (!decoder_)
|
| return;
|
|
|
| - gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
|
| + gles2::ImageManager* image_manager = decoder_->GetImageManager();
|
| DCHECK(image_manager);
|
| if (image_manager->LookupImage(id)) {
|
| LOG(ERROR) << "Image already exists with same ID.";
|
| return;
|
| }
|
|
|
| - if (!gpu::ImageFactory::IsGpuMemoryBufferFormatSupported(
|
| + if (!ImageFactory::IsGpuMemoryBufferFormatSupported(
|
| format, decoder_->GetCapabilities())) {
|
| LOG(ERROR) << "Format is not supported.";
|
| return;
|
| }
|
|
|
| - if (!gpu::ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(size,
|
| + if (!ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(size,
|
| format)) {
|
| LOG(ERROR) << "Invalid image size for format.";
|
| return;
|
| }
|
|
|
| - if (!gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
|
| + if (!ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
|
| internalformat, format)) {
|
| LOG(ERROR) << "Incompatible image format.";
|
| return;
|
| @@ -1038,7 +1038,7 @@ void GpuCommandBufferStub::OnDestroyImage(int32_t id) {
|
| if (!decoder_)
|
| return;
|
|
|
| - gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
|
| + gles2::ImageManager* image_manager = decoder_->GetImageManager();
|
| DCHECK(image_manager);
|
| if (!image_manager->LookupImage(id)) {
|
| LOG(ERROR) << "Image with ID doesn't exist.";
|
| @@ -1074,18 +1074,18 @@ void GpuCommandBufferStub::RemoveDestructionObserver(
|
| destruction_observers_.RemoveObserver(observer);
|
| }
|
|
|
| -const gpu::gles2::FeatureInfo* GpuCommandBufferStub::GetFeatureInfo() const {
|
| +const gles2::FeatureInfo* GpuCommandBufferStub::GetFeatureInfo() const {
|
| return context_group_->feature_info();
|
| }
|
|
|
| -gpu::gles2::MemoryTracker* GpuCommandBufferStub::GetMemoryTracker() const {
|
| +gles2::MemoryTracker* GpuCommandBufferStub::GetMemoryTracker() const {
|
| return context_group_->memory_tracker();
|
| }
|
|
|
| bool GpuCommandBufferStub::CheckContextLost() {
|
| DCHECK(command_buffer_);
|
| - gpu::CommandBuffer::State state = command_buffer_->GetLastState();
|
| - bool was_lost = state.error == gpu::error::kLostContext;
|
| + CommandBuffer::State state = command_buffer_->GetLastState();
|
| + bool was_lost = state.error == error::kLostContext;
|
|
|
| if (was_lost) {
|
| bool was_lost_by_robustness =
|
| @@ -1118,13 +1118,13 @@ bool GpuCommandBufferStub::CheckContextLost() {
|
|
|
| void GpuCommandBufferStub::MarkContextLost() {
|
| if (!command_buffer_ ||
|
| - command_buffer_->GetLastState().error == gpu::error::kLostContext)
|
| + command_buffer_->GetLastState().error == error::kLostContext)
|
| return;
|
|
|
| - command_buffer_->SetContextLostReason(gpu::error::kUnknown);
|
| + command_buffer_->SetContextLostReason(error::kUnknown);
|
| if (decoder_)
|
| - decoder_->MarkContextLost(gpu::error::kUnknown);
|
| - command_buffer_->SetParseError(gpu::error::kLostContext);
|
| + decoder_->MarkContextLost(error::kUnknown);
|
| + command_buffer_->SetParseError(error::kLostContext);
|
| }
|
|
|
| void GpuCommandBufferStub::SendSwapBuffersCompleted(
|
| @@ -1140,4 +1140,4 @@ void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
|
| interval));
|
| }
|
|
|
| -} // namespace content
|
| +} // namespace gpu
|
|
|