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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h

Issue 2643343002: DrawingBuffer: Use gfx::GpuMemoryBuffer directly and set color space (Closed)
Patch Set: Fix buffer format Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/command_buffer/common/capabilities.h" 5 #include "gpu/command_buffer/common/capabilities.h"
6 #include "platform/RuntimeEnabledFeatures.h" 6 #include "platform/RuntimeEnabledFeatures.h"
7 #include "platform/graphics/gpu/DrawingBuffer.h" 7 #include "platform/graphics/gpu/DrawingBuffer.h"
8 #include "platform/graphics/gpu/Extensions3DUtil.h" 8 #include "platform/graphics/gpu/Extensions3DUtil.h"
9 #include "public/platform/WebGraphicsContext3DProvider.h" 9 #include "public/platform/WebGraphicsContext3DProvider.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 GLsizei height, 232 GLsizei height,
233 GLint border, 233 GLint border,
234 GLenum format, 234 GLenum format,
235 GLenum type, 235 GLenum type,
236 const void* pixels) override { 236 const void* pixels) override {
237 if (target == GL_TEXTURE_2D && !level) { 237 if (target == GL_TEXTURE_2D && !level) {
238 m_textureSizes.set(m_boundTextures[target], IntSize(width, height)); 238 m_textureSizes.set(m_boundTextures[target], IntSize(width, height));
239 } 239 }
240 } 240 }
241 241
242 GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width, 242 GLuint CreateImageCHROMIUM(ClientBuffer buffer,
243 GLsizei height, 243 GLsizei width,
244 GLenum internalformat, 244 GLsizei height,
245 GLenum usage) override { 245 GLenum internalformat) override {
246 if (m_createImageChromiumFail) 246 if (m_createImageChromiumFail)
247 return 0; 247 return 0;
248 m_imageSizes.set(m_currentImageId, IntSize(width, height)); 248 m_imageSizes.set(m_currentImageId, IntSize(width, height));
249 return m_currentImageId++; 249 return m_currentImageId++;
250 } 250 }
251 251
252 MOCK_METHOD1(DestroyImageMock, void(GLuint imageId)); 252 MOCK_METHOD1(DestroyImageMock, void(GLuint imageId));
253 void DestroyImageCHROMIUM(GLuint imageId) { 253 void DestroyImageCHROMIUM(GLuint imageId) {
254 m_imageSizes.remove(imageId); 254 m_imageSizes.remove(imageId);
255 // No textures should be bound to this. 255 // No textures should be bound to this.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 GLbyte m_currentMailboxByte = 0; 392 GLbyte m_currentMailboxByte = 0;
393 IntSize m_mostRecentlyProducedSize; 393 IntSize m_mostRecentlyProducedSize;
394 bool m_createImageChromiumFail = false; 394 bool m_createImageChromiumFail = false;
395 GLuint m_currentImageId = 1; 395 GLuint m_currentImageId = 1;
396 HashMap<GLuint, IntSize> m_textureSizes; 396 HashMap<GLuint, IntSize> m_textureSizes;
397 HashMap<GLuint, IntSize> m_imageSizes; 397 HashMap<GLuint, IntSize> m_imageSizes;
398 HashMap<GLuint, GLuint> m_imageToTextureMap; 398 HashMap<GLuint, GLuint> m_imageToTextureMap;
399 }; 399 };
400 400
401 } // blink 401 } // blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698