Chromium Code Reviews| 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 "webkit/support/test_webkit_platform_support.h" | 5 #include "webkit/support/test_webkit_platform_support.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); | 432 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); |
| 433 if (!context->Initialize(attributes, NULL)) | 433 if (!context->Initialize(attributes, NULL)) |
| 434 return NULL; | 434 return NULL; |
| 435 return context.release(); | 435 return context.release(); |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 NOTREACHED(); | 438 NOTREACHED(); |
| 439 return NULL; | 439 return NULL; |
| 440 } | 440 } |
| 441 | 441 |
| 442 WebKit::WebGraphicsContext3D* | |
| 443 TestWebKitPlatformSupport::sharedOffscreenGraphicsContext3D() { | |
| 444 static WebKit::WebGraphicsContext3D* context = NULL; | |
|
piman
2013/02/11 18:19:46
/Cry. Can't we make this a member?
danakj
2013/02/11 18:22:06
Uhm, yah I guess so!
danakj
2013/02/11 18:33:57
Done.
| |
| 445 if (!context) { | |
| 446 WebKit::WebGraphicsContext3D::Attributes attributes; | |
| 447 attributes.depth = false; | |
| 448 attributes.stencil = true; | |
| 449 attributes.antialias = false; | |
| 450 attributes.shareResources = true; | |
| 451 attributes.noAutomaticFlushes = true; | |
| 452 context = createOffscreenGraphicsContext3D(attributes); | |
| 453 } | |
| 454 return context; | |
| 455 } | |
| 456 | |
| 457 | |
| 442 bool TestWebKitPlatformSupport::canAccelerate2dCanvas() { | 458 bool TestWebKitPlatformSupport::canAccelerate2dCanvas() { |
| 443 // We supply an OS-MESA based context for accelarated 2d | 459 // We supply an OS-MESA based context for accelarated 2d |
| 444 // canvas, which should always work. | 460 // canvas, which should always work. |
| 445 return true; | 461 return true; |
| 446 } | 462 } |
| 447 | 463 |
| 448 double TestWebKitPlatformSupport::audioHardwareSampleRate() { | 464 double TestWebKitPlatformSupport::audioHardwareSampleRate() { |
| 449 return 44100.0; | 465 return 44100.0; |
| 450 } | 466 } |
| 451 | 467 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 604 return 0; | 620 return 0; |
| 605 } | 621 } |
| 606 | 622 |
| 607 WebKit::WebGestureCurve* TestWebKitPlatformSupport::createFlingAnimationCurve( | 623 WebKit::WebGestureCurve* TestWebKitPlatformSupport::createFlingAnimationCurve( |
| 608 int device_source, | 624 int device_source, |
| 609 const WebKit::WebFloatPoint& velocity, | 625 const WebKit::WebFloatPoint& velocity, |
| 610 const WebKit::WebSize& cumulative_scroll) { | 626 const WebKit::WebSize& cumulative_scroll) { |
| 611 // Caller will retain and release. | 627 // Caller will retain and release. |
| 612 return new WebGestureCurveMock(velocity, cumulative_scroll); | 628 return new WebGestureCurveMock(velocity, cumulative_scroll); |
| 613 } | 629 } |
| OLD | NEW |