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

Unified Diff: tests/DeferredCanvasTest.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/CanvasTest.cpp ('k') | tests/GradientTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DeferredCanvasTest.cpp
===================================================================
--- tests/DeferredCanvasTest.cpp (revision 10994)
+++ tests/DeferredCanvasTest.cpp (working copy)
@@ -7,9 +7,9 @@
*/
#include "Test.h"
#include "SkBitmap.h"
+#include "SkBitmapDevice.h"
#include "SkBitmapProcShader.h"
#include "SkDeferredCanvas.h"
-#include "SkDevice.h"
#include "SkGradientShader.h"
#include "SkShader.h"
#include "../src/image/SkSurface_Base.h"
@@ -33,7 +33,7 @@
SkBitmap store;
create(&store, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->clear(0x00000000);
@@ -259,7 +259,7 @@
SkBitmap store;
create(&store, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->clear(0x00000000);
@@ -279,7 +279,7 @@
partialRect.setXYWH(SkIntToScalar(0), SkIntToScalar(0),
SkIntToScalar(1), SkIntToScalar(1));
create(&store, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
// verify that frame is intially fresh
@@ -433,9 +433,9 @@
}
}
-class MockDevice : public SkDevice {
+class MockDevice : public SkBitmapDevice {
public:
- MockDevice(const SkBitmap& bm) : SkDevice(bm) {
+ MockDevice(const SkBitmap& bm) : SkBitmapDevice(bm) {
fDrawBitmapCallCount = 0;
}
virtual void drawBitmap(const SkDraw&, const SkBitmap&,
@@ -502,7 +502,7 @@
SkBitmap store;
store.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
store.allocPixels();
- SkDevice device(store);
+ SkBitmapDevice device(store);
NotificationCounter notificationCounter;
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->setNotificationClient(&notificationCounter);
@@ -585,7 +585,7 @@
SkBitmap store;
store.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
store.allocPixels();
- SkDevice device(store);
+ SkBitmapDevice device(store);
NotificationCounter notificationCounter;
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->setNotificationClient(&notificationCounter);
@@ -606,7 +606,7 @@
SkBitmap store;
store.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
store.allocPixels();
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
// test will fail if nbIterations is not in sync with
// BITMAPS_TO_KEEP in SkGPipeWrite.cpp
@@ -652,7 +652,7 @@
// 1 under : should not store the image
{
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->setBitmapSizeThreshold(39999);
canvas->drawBitmap(sourceImage, 0, 0, NULL);
@@ -662,7 +662,7 @@
// exact value : should store the image
{
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->setBitmapSizeThreshold(40000);
canvas->drawBitmap(sourceImage, 0, 0, NULL);
@@ -672,7 +672,7 @@
// 1 over : should still store the image
{
- SkDevice device(store);
+ SkBitmapDevice device(store);
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->setBitmapSizeThreshold(40001);
canvas->drawBitmap(sourceImage, 0, 0, NULL);
@@ -807,11 +807,11 @@
SkBitmap store;
store.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
store.allocPixels();
- SkDevice device(store);
+ SkBitmapDevice device(store);
NotificationCounter notificationCounter;
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(&device));
canvas->setNotificationClient(&notificationCounter);
- SkAutoTUnref<SkDevice> secondaryDevice(canvas->createCompatibleDevice(
+ SkAutoTUnref<SkBaseDevice> secondaryDevice(canvas->createCompatibleDevice(
SkBitmap::kARGB_8888_Config, 10, 10, device.isOpaque()));
SkCanvas secondaryCanvas(secondaryDevice.get());
SkRect rect = SkRect::MakeWH(5, 5);
« no previous file with comments | « tests/CanvasTest.cpp ('k') | tests/GradientTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698