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

Unified Diff: skia/ext/vector_platform_device_win.cc

Issue 259047: Move classes depending on Skia out of base/gfx and into app/gfx. Rename... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « skia/ext/vector_canvas_unittest.cc ('k') | views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/vector_platform_device_win.cc
===================================================================
--- skia/ext/vector_platform_device_win.cc (revision 28001)
+++ skia/ext/vector_platform_device_win.cc (working copy)
@@ -6,12 +6,25 @@
#include "skia/ext/vector_platform_device_win.h"
-#include "base/gfx/gdi_util.h"
#include "skia/ext/skia_utils_win.h"
#include "third_party/skia/include/core/SkUtils.h"
namespace skia {
+static void FillBitmapInfoHeader(int width, int height, BITMAPINFOHEADER* hdr) {
+ hdr->biSize = sizeof(BITMAPINFOHEADER);
+ hdr->biWidth = width;
+ hdr->biHeight = -height; // Minus means top-down bitmap.
+ hdr->biPlanes = 1;
+ hdr->biBitCount = 32;
+ hdr->biCompression = BI_RGB; // no compression
+ hdr->biSizeImage = 0;
+ hdr->biXPelsPerMeter = 1;
+ hdr->biYPelsPerMeter = 1;
+ hdr->biClrUsed = 0;
+ hdr->biClrImportant = 0;
+}
+
VectorPlatformDevice* VectorPlatformDevice::create(HDC dc,
int width, int height) {
InitializeDC(dc);
@@ -562,9 +575,18 @@
if (!src_size_x || !src_size_y)
return;
- // Create a BMP v4 header that we can serialize.
+ // Create a BMP v4 header that we can serialize. We use the shared "V3"
+ // fillter to fill the stardard items, then add in the "V4" stuff we want.
BITMAPV4HEADER bitmap_header;
- gfx::CreateBitmapV4Header(src_size_x, src_size_y, &bitmap_header);
+ memset(&bitmap_header, 0, sizeof(BITMAPV4HEADER));
+ FillBitmapInfoHeader(src_size_x, src_size_y,
+ reinterpret_cast<BITMAPINFOHEADER*>(&bitmap_header));
+ bitmap_header.bV4Size = sizeof(BITMAPV4HEADER);
+ bitmap_header.bV4RedMask = 0x00ff0000;
+ bitmap_header.bV4GreenMask = 0x0000ff00;
+ bitmap_header.bV4BlueMask = 0x000000ff;
+ bitmap_header.bV4AlphaMask = 0xff000000;
+
HDC dc = getBitmapDC();
SkAutoLockPixels lock(bitmap);
SkASSERT(bitmap.getConfig() == SkBitmap::kARGB_8888_Config);
@@ -589,7 +611,7 @@
}
BITMAPINFOHEADER hdr;
- gfx::CreateBitmapHeader(src_size_x, src_size_y, &hdr);
+ FillBitmapInfoHeader(src_size_x, src_size_y, &hdr);
if (is_translucent) {
// The image must be loaded as a bitmap inside a device context.
HDC bitmap_dc = ::CreateCompatibleDC(dc);
« no previous file with comments | « skia/ext/vector_canvas_unittest.cc ('k') | views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698