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

Side by Side Diff: Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for shape bug Created 5 years, 6 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 | Annotate | Revision Log
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 #include "config.h" 5 #include "config.h"
6 #include "platform/graphics/RecordingImageBufferSurface.h" 6 #include "platform/graphics/RecordingImageBufferSurface.h"
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/ImageBuffer.h" 9 #include "platform/graphics/ImageBuffer.h"
10 #include "platform/graphics/ImageBufferClient.h" 10 #include "platform/graphics/ImageBufferClient.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); 197 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount());
198 m_testSurface->getPicture(); 198 m_testSurface->getPicture();
199 EXPECT_EQ(3, m_fakeImageBufferClient->frameCount()); 199 EXPECT_EQ(3, m_fakeImageBufferClient->frameCount());
200 expectDisplayListEnabled(true); 200 expectDisplayListEnabled(true);
201 } 201 }
202 202
203 void testClearRect() 203 void testClearRect()
204 { 204 {
205 m_testSurface->initializeCurrentFrame(); 205 m_testSurface->initializeCurrentFrame();
206 m_testSurface->getPicture(); 206 m_testSurface->getPicture();
207 m_imageBuffer->context()->clearRect(FloatRect(FloatPoint(0, 0), FloatSiz e(m_testSurface->size()))); 207 SkPaint clearPaint;
208 clearPaint.setXfermodeMode(SkXfermode::kClear_Mode);
209 m_imageBuffer->canvas()->drawRect(SkRect::MakeWH(m_testSurface->size().w idth(), m_testSurface->size().height()), clearPaint);
208 m_fakeImageBufferClient->fakeDraw(); 210 m_fakeImageBufferClient->fakeDraw();
209 EXPECT_EQ(1, m_fakeImageBufferClient->frameCount()); 211 EXPECT_EQ(1, m_fakeImageBufferClient->frameCount());
210 m_testSurface->getPicture(); 212 m_testSurface->getPicture();
211 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); 213 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount());
212 expectDisplayListEnabled(true); 214 expectDisplayListEnabled(true);
213 } 215 }
214 216
215 void expectDisplayListEnabled(bool displayListEnabled) 217 void expectDisplayListEnabled(bool displayListEnabled)
216 { 218 {
217 EXPECT_EQ(displayListEnabled, (bool)m_testSurface->m_currentFrame.get()) ; 219 EXPECT_EQ(displayListEnabled, (bool)m_testSurface->m_currentFrame.get()) ;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 389 }
388 390
389 DEFINE_TEST_TASK_WRAPPER_CLASS(testClearRect) 391 DEFINE_TEST_TASK_WRAPPER_CLASS(testClearRect)
390 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) 392 TEST_F(RecordingImageBufferSurfaceTest, testClearRect)
391 { 393 {
392 CALL_TEST_TASK_WRAPPER(testClearRect); 394 CALL_TEST_TASK_WRAPPER(testClearRect);
393 expectDisplayListEnabled(true); 395 expectDisplayListEnabled(true);
394 } 396 }
395 397
396 } // namespace blink 398 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/RecordingImageBufferSurface.cpp ('k') | Source/platform/mac/LocalCurrentGraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698