OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/ipc/service/gpu_command_buffer_stub.h" | 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 if (!decoder_) | 1125 if (!decoder_) |
1126 return; | 1126 return; |
1127 | 1127 |
1128 gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 1128 gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
1129 DCHECK(image_manager); | 1129 DCHECK(image_manager); |
1130 if (image_manager->LookupImage(id)) { | 1130 if (image_manager->LookupImage(id)) { |
1131 LOG(ERROR) << "Image already exists with same ID."; | 1131 LOG(ERROR) << "Image already exists with same ID."; |
1132 return; | 1132 return; |
1133 } | 1133 } |
1134 | 1134 |
1135 if (!gpu::IsGpuMemoryBufferFormatSupported(format, | 1135 if (!gpu::IsImageFromGpuMemoryBufferFormatSupported( |
1136 decoder_->GetCapabilities())) { | 1136 format, decoder_->GetCapabilities())) { |
1137 LOG(ERROR) << "Format is not supported."; | 1137 LOG(ERROR) << "Format is not supported."; |
1138 return; | 1138 return; |
1139 } | 1139 } |
1140 | 1140 |
1141 if (!gpu::IsImageSizeValidForGpuMemoryBufferFormat(size, format)) { | 1141 if (!gpu::IsImageSizeValidForGpuMemoryBufferFormat(size, format)) { |
1142 LOG(ERROR) << "Invalid image size for format."; | 1142 LOG(ERROR) << "Invalid image size for format."; |
1143 return; | 1143 return; |
1144 } | 1144 } |
1145 | 1145 |
1146 if (!gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat(internalformat, | 1146 if (!gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat(internalformat, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 command_buffer_->GetLastState().error == error::kLostContext) | 1238 command_buffer_->GetLastState().error == error::kLostContext) |
1239 return; | 1239 return; |
1240 | 1240 |
1241 command_buffer_->SetContextLostReason(error::kUnknown); | 1241 command_buffer_->SetContextLostReason(error::kUnknown); |
1242 if (decoder_) | 1242 if (decoder_) |
1243 decoder_->MarkContextLost(error::kUnknown); | 1243 decoder_->MarkContextLost(error::kUnknown); |
1244 command_buffer_->SetParseError(error::kLostContext); | 1244 command_buffer_->SetParseError(error::kLostContext); |
1245 } | 1245 } |
1246 | 1246 |
1247 } // namespace gpu | 1247 } // namespace gpu |
OLD | NEW |