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

Side by Side Diff: src/pipe/SkGPipeWrite.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT, re-add SkBaseDevice::config & default parameter 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 fDone = false; 425 fDone = false;
426 fBlockSize = 0; // need first block from controller 426 fBlockSize = 0; // need first block from controller
427 fBytesNotified = 0; 427 fBytesNotified = 0;
428 fFirstSaveLayerStackLevel = kNoSaveLayer; 428 fFirstSaveLayerStackLevel = kNoSaveLayer;
429 sk_bzero(fCurrFlatIndex, sizeof(fCurrFlatIndex)); 429 sk_bzero(fCurrFlatIndex, sizeof(fCurrFlatIndex));
430 430
431 // we need a device to limit our clip 431 // we need a device to limit our clip
432 // We don't allocate pixels for the bitmap 432 // We don't allocate pixels for the bitmap
433 SkBitmap bitmap; 433 SkBitmap bitmap;
434 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); 434 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
435 SkDevice* device = SkNEW_ARGS(SkDevice, (bitmap)); 435 SkBaseDevice* device = SkNEW_ARGS(SkBitmapDevice, (bitmap));
436 this->setDevice(device)->unref(); 436 this->setDevice(device)->unref();
437 437
438 // Tell the reader the appropriate flags to use. 438 // Tell the reader the appropriate flags to use.
439 if (this->needOpBytes()) { 439 if (this->needOpBytes()) {
440 this->writeOp(kReportFlags_DrawOp, fFlags, 0); 440 this->writeOp(kReportFlags_DrawOp, fFlags, 0);
441 } 441 }
442 442
443 if (shouldFlattenBitmaps(flags)) { 443 if (shouldFlattenBitmaps(flags)) {
444 BitmapShuttle* shuttle = SkNEW_ARGS(BitmapShuttle, (this)); 444 BitmapShuttle* shuttle = SkNEW_ARGS(BitmapShuttle, (this));
445 fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (shuttle, BITMAPS_TO_KEEP)); 445 fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (shuttle, BITMAPS_TO_KEEP));
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 fCanvas->ref(); 1191 fCanvas->ref();
1192 } 1192 }
1193 1193
1194 BitmapShuttle::~BitmapShuttle() { 1194 BitmapShuttle::~BitmapShuttle() {
1195 fCanvas->unref(); 1195 fCanvas->unref();
1196 } 1196 }
1197 1197
1198 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { 1198 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) {
1199 return fCanvas->shuttleBitmap(bitmap, slot); 1199 return fCanvas->shuttleBitmap(bitmap, slot);
1200 } 1200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698