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

Side by Side Diff: content/test/gpu/page_sets/pixel_tests.py

Issue 1752083003: mac: Use IOSurfaces in Canvas2DLayerBridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp36_canvas2d_refactor
Patch Set: Rebase. Group macros. Created 4 years, 9 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 from telemetry.story import story_set as story_set_module 5 from telemetry.story import story_set as story_set_module
6 6
7 import sys 7 import sys
8 8
9 from gpu_tests import gpu_test_base 9 from gpu_tests import gpu_test_base
10 10
(...skipping 18 matching lines...) Expand all
29 29
30 30
31 class PixelTestsES3SharedPageState(gpu_test_base.GpuSharedPageState): 31 class PixelTestsES3SharedPageState(gpu_test_base.GpuSharedPageState):
32 def __init__(self, test, finder_options, story_set): 32 def __init__(self, test, finder_options, story_set):
33 super(PixelTestsES3SharedPageState, self).__init__( 33 super(PixelTestsES3SharedPageState, self).__init__(
34 test, finder_options, story_set) 34 test, finder_options, story_set)
35 finder_options.browser_options.AppendExtraBrowserArgs( 35 finder_options.browser_options.AppendExtraBrowserArgs(
36 ['--enable-unsafe-es3-apis']) 36 ['--enable-unsafe-es3-apis'])
37 37
38 38
39 class IOSurface2DCanvasSharedPageState(gpu_test_base.GpuSharedPageState):
40 def __init__(self, test, finder_options, story_set):
41 super(IOSurface2DCanvasSharedPageState, self).__init__(
42 test, finder_options, story_set)
43 finder_options.browser_options.AppendExtraBrowserArgs(
44 ['--enable-accelerated-2d-canvas',
45 '--disable-display-list-2d-canvas'])
46
47
39 class PixelTestsStorySet(story_set_module.StorySet): 48 class PixelTestsStorySet(story_set_module.StorySet):
40 49
41 """ Some basic test cases for GPU. """ 50 """ Some basic test cases for GPU. """
42 def __init__(self, expectations, base_name='Pixel', try_es3=False): 51 def __init__(self, expectations, base_name='Pixel', try_es3=False):
43 super(PixelTestsStorySet, self).__init__() 52 super(PixelTestsStorySet, self).__init__()
44 self._AddAllPages(expectations, base_name, False) 53 self._AddAllPages(expectations, base_name, False)
45 # Would be better to fetch this from Telemetry. 54 # Would be better to fetch this from Telemetry.
46 # TODO(kbr): enable this on all platforms. Don't know what will 55 # TODO(kbr): enable this on all platforms. Don't know what will
47 # happen on Android right now. 56 # happen on Android right now.
48 if try_es3 and sys.platform.startswith('darwin'): 57 if try_es3 and sys.platform.startswith('darwin'):
49 # Add all the tests again, this time with the 58 # Add all the tests again, this time with the
50 # --enable-unsafe-es3-apis command line argument. This has the 59 # --enable-unsafe-es3-apis command line argument. This has the
51 # side-effect of enabling the Core Profile rendering path on Mac 60 # side-effect of enabling the Core Profile rendering path on Mac
52 # OS. 61 # OS.
53 self._AddAllPages(expectations, base_name, True) 62 self._AddAllPages(expectations, base_name, True)
54 63
64 # On OS X, test the IOSurface 2D Canvas compositing path.
65 if sys.platform.startswith('darwin'):
66 self.AddStory(PixelTestsPage(
67 url='file://../../data/gpu/pixel_canvas2d_accelerated.html',
68 name=base_name + '.IOSurface2DCanvas',
69 test_rect=[0, 0, 400, 400],
70 revision=1,
71 story_set=self,
72 shared_page_state_class=IOSurface2DCanvasSharedPageState,
73 expectations=expectations))
74
55 def _AddAllPages(self, expectations, base_name, use_es3): 75 def _AddAllPages(self, expectations, base_name, use_es3):
56 if use_es3: 76 if use_es3:
57 es3_suffix = 'ES3' 77 es3_suffix = 'ES3'
58 shared_page_state_class = PixelTestsES3SharedPageState 78 shared_page_state_class = PixelTestsES3SharedPageState
59 else: 79 else:
60 es3_suffix = '' 80 es3_suffix = ''
61 shared_page_state_class = gpu_test_base.GpuSharedPageState 81 shared_page_state_class = gpu_test_base.GpuSharedPageState
62 82
63 self.AddStory(PixelTestsPage( 83 self.AddStory(PixelTestsPage(
64 url='file://../../data/gpu/pixel_canvas2d.html', 84 url='file://../../data/gpu/pixel_canvas2d.html',
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 shared_page_state_class=shared_page_state_class, 116 shared_page_state_class=shared_page_state_class,
97 expectations=expectations, 117 expectations=expectations,
98 expected_colors='../../data/gpu/pixel_scissor_expectations.json')) 118 expected_colors='../../data/gpu/pixel_scissor_expectations.json'))
99 119
100 @property 120 @property
101 def allow_mixed_story_states(self): 121 def allow_mixed_story_states(self):
102 # Return True here in order to be able to add the same tests with 122 # Return True here in order to be able to add the same tests with
103 # a different SharedPageState on Mac which tests them with the 123 # a different SharedPageState on Mac which tests them with the
104 # Core Profile rendering path. 124 # Core Profile rendering path.
105 return True 125 return True
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698