#error "unknown GR_TEXT_SCALAR type"
#endif
-// Pick a pixel config for 32bit bitmaps. Our default is GL_RGBA
-#ifndef SK_GL_32BPP_COLOR_FORMAT
- #define SK_GL_32BPP_COLOR_FORMAT GL_RGBA
+// Pick a pixel config for 32bit bitmaps. Our default is GL_RGBA (expect on
+// Windows where we match GDI's order).
+#ifndef GR_GL_32BPP_COLOR_FORMAT
+ #if GR_WIN32_BUILD
+ #define GR_GL_32BPP_COLOR_FORMAT GL_BGRA
+ #else
+ #define GR_GL_32BPP_COLOR_FORMAT GL_RGBA
+ #endif
#endif
////////////////////////////////////////////////////////////////////////////////
//#define GR_FORCE_GLCHECKERR 1
/*
- * The default 32bit pixel config for texture upload is GL_RGBA. If your
- * bitmaps map to a different GL enum, specify that with this define.
+ * The default 32bit pixel config for texture upload is GL_RGBA on all
+ * platforms except on Windows where it is GL_BGRA. If your bitmaps map to a
+ * different GL enum, specify that with this define.
*/
-//#define SK_GL_32BPP_COLOR_FORMAT GL_RGBA
+//#define GR_GL_32BPP_COLOR_FORMAT GL_RGBA
/*
* To diagnose texture cache performance, define this to 1 if you want to see
#include "GrGpuGL.h"
#include "GrMemory.h"
#include <stdio.h>
+#if GR_WIN32_BUILD
+ // need to get wglGetProcAddress
+ #undef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN 1
+ #include <windows.h>
+ #undef WIN32_LEAN_AND_MEAN
+#endif
+
static const GLuint GR_MAX_GLUINT = ~0;
static const GLint GR_INVAL_GLINT = ~0;
GLuint testRTTex;
GR_GL(GenTextures(1, &testRTTex));
GR_GL(BindTexture(GL_TEXTURE_2D, testRTTex));
-
+ // some implementations require texture to be mip-map complete before
+ // FBO with level 0 bound as color attachment will be framebuffer complete.
+ GR_GL(TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
GR_GL(TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h,
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
GR_GL(BindTexture(GL_TEXTURE_2D, 0));
// Experiments to determine limitations that can't be queried. TODO: Make
// these a preprocess that generate some compile time constants.
+ // sanity check to make sure we can at least create an FBO from a POT texture
+ if (fNPOTTextureSupport < kFull_NPOTTextureType) {
+ bool npotFBOSuccess = fbo_test(fExts, 128, 128);
+ if (gPrintStartupSpew) {
+ if (!npotFBOSuccess) {
+ GrPrintf("FBO Sanity Test: FAILED\n");
+ } else {
+ GrPrintf("FBO Sanity Test: PASSED\n");
+ }
+ }
+ }
+
/* Experimentation has found that some GLs that support NPOT textures
do not support FBOs with a NPOT texture. They report "unsupported" FBO
status. I don't know how to explicitly query for this. Do an
}
}
- // sanity check to make sure we can at least create an FBO from a POT texture
- if (fNPOTTextureSupport < kFull_NPOTTextureType) {
- bool npotFBOSuccess = fbo_test(fExts, 128, 128);
- if (gPrintStartupSpew) {
- if (!npotFBOSuccess) {
- GrPrintf("FBO Sanity Test: FAILED\n");
- } else {
- GrPrintf("FBO Sanity Test: PASSED\n");
- }
- }
- }
-
/* The iPhone 4 has a restriction that for an FBO with texture color
attachment with height <= 8 then the width must be <= height. Here
we look for such a limitation.
switch (config) {
case GrTexture::kRGBA_8888_PixelConfig:
case GrTexture::kRGBX_8888_PixelConfig: // todo: can we tell it our X?
- *format = SK_GL_32BPP_COLOR_FORMAT;
+ *format = GR_GL_32BPP_COLOR_FORMAT;
*internalFormat = GL_RGBA;
*type = GL_UNSIGNED_BYTE;
break;
void get_gl_proc(const char procName[], glProc *address) {
#if GR_WIN32_BUILD
- *address = wglGetProcAddress(procName);
+ *address = (glProc)wglGetProcAddress(procName);
GrAssert(NULL != *address);
#elif GR_MAC_BUILD || GR_IOS_BUILD
GrAssert(!"Extensions don't need to be initialized!");
kNoPerspective_OptFlagBit = 0x1,
kIdentityMatrix_OptFlagBit = 0x2,
};
- int fOptFlags : 8;
- bool fEnabled : 8;
+ unsigned fOptFlags : 8;
+
+ unsigned fEnabled : 8;
+
enum Modulation {
kColor_Modulation,
kAlpha_Modulation,
} fModulation : 8;
+
enum CoordMapping {
kIdentity_CoordMapping,
kRadialGradient_CoordMapping,
// must be tightly packed
struct GrGpuGLShaders2::ProgramDesc {
GrVertexLayout fVertexLayout;
+ GR_STATIC_ASSERT(2 == sizeof(GrVertexLayout)); // pack with next field
+
enum {
kNotPoints_OptFlagBit = 0x1,
kVertexColorAllOnes_OptFlagBit = 0x2,
};
// we're assuming optflags and layout pack into 32 bits
- GR_STATIC_ASSERT(2 == sizeof(GrVertexLayout));
- int fOptFlags : 16;
+ // VS 2010 seems to require short rather than just unsigned
+ // for this to pack
+ unsigned short fOptFlags : 16;
StageDesc fStages[NUM_STAGES];
x = (int)(random.nextF() * GR_ARRAY_COUNT(STAGE_OPTS));
pdesc.fStages[s].fOptFlags = STAGE_OPTS[x];
x = (int)(random.nextF() * GR_ARRAY_COUNT(STAGE_MODULATES));
- pdesc.fStages[s].fModulation = STAGE_MODULATES[x];
+ pdesc.fStages[s].fModulation = (StageDesc::Modulation) STAGE_MODULATES[x];
x = (int)(random.nextF() * GR_ARRAY_COUNT(STAGE_COORD_MAPPINGS));
- pdesc.fStages[s].fCoordMapping = STAGE_COORD_MAPPINGS[x];
+ pdesc.fStages[s].fCoordMapping = (StageDesc::CoordMapping) STAGE_COORD_MAPPINGS[x];
}
Program program;
GenProgram(pdesc, &program);
for (int i = 1; i < NUM_STAGES; ++i) {
desc->fStages[i].fEnabled = false;
desc->fStages[i].fOptFlags = 0;
- desc->fStages[i].fCoordMapping = 0;
- desc->fStages[i].fModulation = 0;
+ desc->fStages[i].fCoordMapping = (StageDesc::CoordMapping)0;
+ desc->fStages[i].fModulation = (StageDesc::Modulation)0;
}
if (primType != kPoints_PrimitiveType) {
stage.fModulation = StageDesc::kColor_Modulation;
break;
case GrSamplerState::kSweep_SampleMode:
- stage.fCoordMapping = StageDesc::StageDesc::kSweepGradient_CoordMapping;
+ stage.fCoordMapping = StageDesc::kSweepGradient_CoordMapping;
stage.fModulation = StageDesc::kColor_Modulation;
break;
default:
}
} else {
stage.fOptFlags = 0;
- stage.fCoordMapping = 0;
- stage.fModulation = 0;
+ stage.fCoordMapping = (StageDesc::CoordMapping)0;
+ stage.fModulation = (StageDesc::Modulation)0;
}
}
extern SkView* create_overview(int, const SkViewFactory[]);
#define SK_SUPPORT_GL
-//#define SK_SUPPORT_D3D9
#define ANIMATING_EVENTTYPE "nextSample"
#define ANIMATING_DELAY 750
#ifdef SK_SUPPORT_GL
#include "GrGLConfig.h"
-#elif defined(SK_SUPPORT_D3D9)
- #include <d3d9.h>
#endif
SkViewRegister* SkViewRegister::gHead;
gHead = this;
}
-#if defined(SK_SUPPORT_GL) && defined(SK_SUPPORT_D3D9)
- #error "choose either GL or D3D9"
-#endif
-
#if defined(SK_SUPPORT_GL)
#define SK_USE_SHADERS
#endif
#else
ctx = GrContext::Create(GrGpu::kOpenGL_Fixed_Engine, NULL);
#endif
-#elif defined(SK_SUPPORT_D3D9)
- if (oswin->d3d9Device()) {
- ctx = GrContext::Create(GrGpu::kDirect3D9_Engine,
- (IDirect3DDevice9*) oswin->d3d9Device());
- }
#endif
}
return ctx;
class SampleWindow : public SkOSWindow {
SkTDArray<SkViewFactory> fSamples;
public:
- SampleWindow(void* hwnd);
- virtual ~SampleWindow();
+ SampleWindow(void* hwnd);
+ virtual ~SampleWindow();
virtual void draw(SkCanvas* canvas);
protected:
virtual void onDraw(SkCanvas* canvas);
- virtual bool onHandleKey(SkKey key);
+ virtual bool onHandleKey(SkKey key);
virtual bool onHandleChar(SkUnichar);
virtual void onSizeChange();
virtual void beforeChild(SkView* child, SkCanvas* canvas);
virtual void afterChild(SkView* child, SkCanvas* canvas);
- virtual bool onEvent(const SkEvent& evt);
+ virtual bool onEvent(const SkEvent& evt);
virtual bool onQuery(SkEvent* evt);
#if 0
- virtual bool handleChar(SkUnichar uni);
- virtual bool handleEvent(const SkEvent& evt);
- virtual bool handleKey(SkKey key);
- virtual bool handleKeyUp(SkKey key);
+ virtual bool handleChar(SkUnichar uni);
+ virtual bool handleEvent(const SkEvent& evt);
+ virtual bool handleKey(SkKey key);
+ virtual bool handleKeyUp(SkKey key);
- virtual bool onClick(Click* click);
- virtual Click* onFindClickHandler(SkScalar x, SkScalar y);
+ virtual bool onClick(Click* click);
+ virtual Click* onFindClickHandler(SkScalar x, SkScalar y);
virtual bool onHandleKeyUp(SkKey key);
#endif
private:
fScrollTestX = fScrollTestY = 0;
-// this->setConfig(SkBitmap::kRGB_565_Config);
- this->setConfig(SkBitmap::kARGB_8888_Config);
- this->setVisibleP(true);
+// this->setConfig(SkBitmap::kRGB_565_Config);
+ this->setConfig(SkBitmap::kARGB_8888_Config);
+ this->setVisibleP(true);
this->setClipToBounds(false);
{
if (kGPU_CanvasType != fCanvasType) {
#ifdef SK_SUPPORT_GL
detachGL();
-#elif defined(SK_SUPPORT_D3D9)
- detachD3D9();
#endif
}
attachGL(NULL);
#endif
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
-#elif defined(SK_SUPPORT_D3D9)
- // now setup our canvas
- attachD3D9();
#endif
fGpuCanvas = new SkGpuCanvas(get_global_grctx(this));
- device = fGpuCanvas->createDevice(SkBitmap::kARGB_8888_Config,
- bitmap.width(), bitmap.height(),
- false, false);
+ device = fGpuCanvas->createDevice(SkBitmap::kARGB_8888_Config,
+ bitmap.width(), bitmap.height(),
+ false, false);
fGpuCanvas->setDevice(device)->unref();
canvas = fGpuCanvas;
delete fGpuCanvas;
fGpuCanvas = NULL;
presentGL();
-#ifdef USE_OFFSCREEN
+ #ifdef USE_OFFSCREEN
reverseRedAndBlue(orig->getDevice()->accessBitmap(true));
-#endif
- break;
-#elif defined(SK_SUPPORT_D3D9)
- case kGPU_CanvasType: {
- delete fGpuCanvas;
- fGpuCanvas = NULL;
- presentD3D9();
+ #endif
break;
- }
#endif
-
}
// if ((fScrollTestX | fScrollTestY) != 0)
SkOSWindow* create_sk_window(void* hwnd) {
// test();
- return new SampleWindow(hwnd);
+ return new SampleWindow(hwnd);
}
void get_preferred_size(int* x, int* y, int* width, int* height) {
#ifdef SK_BUILD_FOR_MAC
setenv("ANDROID_ROOT", "/android/device/data", 0);
#endif
- SkGraphics::Init();
- SkEvent::Init();
+ SkGraphics::Init();
+ SkEvent::Init();
}
void application_term() {
- SkEvent::Term();
- SkGraphics::Term();
+ SkEvent::Term();
+ SkGraphics::Term();
}
}
static SkKey winToskKey(WPARAM vk) {
- static const struct {
- WPARAM fVK;
- SkKey fKey;
- } gPair[] = {
- { VK_BACK, kBack_SkKey },
- { VK_CLEAR, kBack_SkKey },
- { VK_RETURN, kOK_SkKey },
- { VK_UP, kUp_SkKey },
- { VK_DOWN, kDown_SkKey },
- { VK_LEFT, kLeft_SkKey },
- { VK_RIGHT, kRight_SkKey }
- };
- for (size_t i = 0; i < SK_ARRAY_COUNT(gPair); i++) {
- if (gPair[i].fVK == vk) {
- return gPair[i].fKey;
- }
- }
- return kNONE_SkKey;
+ static const struct {
+ WPARAM fVK;
+ SkKey fKey;
+ } gPair[] = {
+ { VK_BACK, kBack_SkKey },
+ { VK_CLEAR, kBack_SkKey },
+ { VK_RETURN, kOK_SkKey },
+ { VK_UP, kUp_SkKey },
+ { VK_DOWN, kDown_SkKey },
+ { VK_LEFT, kLeft_SkKey },
+ { VK_RIGHT, kRight_SkKey }
+ };
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gPair); i++) {
+ if (gPair[i].fVK == vk) {
+ return gPair[i].fKey;
+ }
+ }
+ return kNONE_SkKey;
}
bool SkOSWindow::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
- switch (message) {
- case WM_KEYDOWN: {
- SkKey key = winToskKey(wParam);
- if (kNONE_SkKey != key) {
- this->handleKey(key);
- return true;
- }
- } break;
- case WM_KEYUP: {
- SkKey key = winToskKey(wParam);
- if (kNONE_SkKey != key) {
- this->handleKeyUp(key);
- return true;
- }
- } break;
- case WM_UNICHAR:
- this->handleChar(wParam);
+ switch (message) {
+ case WM_KEYDOWN: {
+ SkKey key = winToskKey(wParam);
+ if (kNONE_SkKey != key) {
+ this->handleKey(key);
+ return true;
+ }
+ } break;
+ case WM_KEYUP: {
+ SkKey key = winToskKey(wParam);
+ if (kNONE_SkKey != key) {
+ this->handleKeyUp(key);
+ return true;
+ }
+ } break;
+ case WM_UNICHAR:
+ this->handleChar(wParam);
return true;
case WM_CHAR: {
this->handleChar(SkUTF8_ToUnichar((char*)&wParam));
return true;
} break;
- case WM_SIZE:
- this->resize(lParam & 0xFFFF, lParam >> 16);
- break;
- case WM_PAINT: {
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hWnd, &ps);
- this->doPaint(hdc);
- EndPaint(hWnd, &ps);
- return true;
+ case WM_SIZE:
+ this->resize(lParam & 0xFFFF, lParam >> 16);
+ break;
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hWnd, &ps);
+ this->doPaint(hdc);
+ EndPaint(hWnd, &ps);
+ return true;
} break;
case WM_TIMER: {
post_skwinevent();
}
return true;
- }
- return false;
+ }
+ return false;
}
void SkOSWindow::doPaint(void* ctx) {
- this->update(NULL);
+ this->update(NULL);
if (!fGLAttached && !fD3D9Attached)
{
- HDC hdc = (HDC)ctx;
+ HDC hdc = (HDC)ctx;
const SkBitmap& bitmap = this->getBitmap();
- BITMAPINFO bmi;
- memset(&bmi, 0, sizeof(bmi));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = bitmap.width();
- bmi.bmiHeader.biHeight = -bitmap.height(); // top-down image
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = 32;
- bmi.bmiHeader.biCompression = BI_RGB;
- bmi.bmiHeader.biSizeImage = 0;
-
- //
- // Do the SetDIBitsToDevice.
- //
+ BITMAPINFO bmi;
+ memset(&bmi, 0, sizeof(bmi));
+ bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi.bmiHeader.biWidth = bitmap.width();
+ bmi.bmiHeader.biHeight = -bitmap.height(); // top-down image
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = 32;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biSizeImage = 0;
+
+ //
+ // Do the SetDIBitsToDevice.
+ //
SkASSERT(bitmap.width() * bitmap.bytesPerPixel() == bitmap.rowBytes());
- bitmap.lockPixels();
- int iRet = SetDIBitsToDevice(hdc,
- 0, 0,
- bitmap.width(), bitmap.height(),
- 0, 0,
- 0, bitmap.height(),
- bitmap.getPixels(),
- &bmi,
- DIB_RGB_COLORS);
- bitmap.unlockPixels();
+ bitmap.lockPixels();
+ int iRet = SetDIBitsToDevice(hdc,
+ 0, 0,
+ bitmap.width(), bitmap.height(),
+ 0, 0,
+ 0, bitmap.height(),
+ bitmap.getPixels(),
+ &bmi,
+ DIB_RGB_COLORS);
+ bitmap.unlockPixels();
}
}
#if 0
void SkOSWindow::updateSize()
{
- RECT r;
- GetWindowRect((HWND)this->getHWND(), &r);
- this->resize(r.right - r.left, r.bottom - r.top);
+ RECT r;
+ GetWindowRect((HWND)this->getHWND(), &r);
+ this->resize(r.right - r.left, r.bottom - r.top);
}
#endif
void SkOSWindow::onHandleInval(const SkIRect& r) {
- RECT* rect = new RECT;
- rect->left = r.fLeft;
- rect->top = r.fTop;
- rect->right = r.fRight;
- rect->bottom = r.fBottom;
+ RECT* rect = new RECT;
+ rect->left = r.fLeft;
+ rect->top = r.fTop;
+ rect->right = r.fRight;
+ rect->bottom = r.fBottom;
SetTimer((HWND)fHWND, (UINT_PTR)rect, INVALIDATE_DELAY_MS, NULL);
}
}
enum {
- SK_MacReturnKey = 36,
- SK_MacDeleteKey = 51,
- SK_MacEndKey = 119,
- SK_MacLeftKey = 123,
- SK_MacRightKey = 124,
- SK_MacDownKey = 125,
- SK_MacUpKey = 126,
+ SK_MacReturnKey = 36,
+ SK_MacDeleteKey = 51,
+ SK_MacEndKey = 119,
+ SK_MacLeftKey = 123,
+ SK_MacRightKey = 124,
+ SK_MacDownKey = 125,
+ SK_MacUpKey = 126,
SK_Mac0Key = 0x52,
SK_Mac1Key = 0x53,
SK_Mac8Key = 0x5b,
SK_Mac9Key = 0x5c
};
-
+
static SkKey raw2key(uint32_t raw)
{
- static const struct {
- uint32_t fRaw;
- SkKey fKey;
- } gKeys[] = {
- { SK_MacUpKey, kUp_SkKey },
- { SK_MacDownKey, kDown_SkKey },
- { SK_MacLeftKey, kLeft_SkKey },
- { SK_MacRightKey, kRight_SkKey },
- { SK_MacReturnKey, kOK_SkKey },
- { SK_MacDeleteKey, kBack_SkKey },
- { SK_MacEndKey, kEnd_SkKey },
+ static const struct {
+ uint32_t fRaw;
+ SkKey fKey;
+ } gKeys[] = {
+ { SK_MacUpKey, kUp_SkKey },
+ { SK_MacDownKey, kDown_SkKey },
+ { SK_MacLeftKey, kLeft_SkKey },
+ { SK_MacRightKey, kRight_SkKey },
+ { SK_MacReturnKey, kOK_SkKey },
+ { SK_MacDeleteKey, kBack_SkKey },
+ { SK_MacEndKey, kEnd_SkKey },
{ SK_Mac0Key, k0_SkKey },
{ SK_Mac1Key, k1_SkKey },
{ SK_Mac2Key, k2_SkKey },
{ SK_Mac7Key, k7_SkKey },
{ SK_Mac8Key, k8_SkKey },
{ SK_Mac9Key, k9_SkKey }
- };
-
- for (unsigned i = 0; i < SK_ARRAY_COUNT(gKeys); i++)
- if (gKeys[i].fRaw == raw)
- return gKeys[i].fKey;
- return kNONE_SkKey;
+ };
+
+ for (unsigned i = 0; i < SK_ARRAY_COUNT(gKeys); i++)
+ if (gKeys[i].fRaw == raw)
+ return gKeys[i].fKey;
+ return kNONE_SkKey;
}
///////////////////////////////////////////////////////////////////////////////////////
void SkEvent::SignalNonEmptyQueue()
{
- post_skwinevent();
- //SkDebugf("signal nonempty\n");
+ post_skwinevent();
+ //SkDebugf("signal nonempty\n");
}
static UINT_PTR gTimer;
VOID CALLBACK sk_timer_proc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
- SkEvent::ServiceQueueTimer();
- //SkDebugf("timer task fired\n");
+ SkEvent::ServiceQueueTimer();
+ //SkDebugf("timer task fired\n");
}
void SkEvent::SignalQueueTimer(SkMSec delay)
{
- if (gTimer)
- {
+ if (gTimer)
+ {
KillTimer(NULL, gTimer);
- gTimer = NULL;
+ gTimer = NULL;
}
- if (delay)
- {
+ if (delay)
+ {
gTimer = SetTimer(NULL, 0, delay, sk_timer_proc);
//SkDebugf("SetTimer of %d returned %d\n", delay, gTimer);
- }
+ }
}
static HWND create_dummy()
{
- HMODULE module = GetModuleHandle(NULL);
- HWND dummy;
- RECT windowRect;
- windowRect.left = 0;
- windowRect.right = 8;
- windowRect.top = 0;
- windowRect.bottom = 8;
-
- WNDCLASS wc;
-
- wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
- wc.lpfnWndProc = (WNDPROC) DefWindowProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = module;
- wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = NULL;
- wc.lpszMenuName = NULL;
- wc.lpszClassName = L"DummyWindow";
-
- if(!RegisterClass(&wc))
- {
- return 0;
- }
-
- DWORD style, exStyle;
- exStyle = WS_EX_CLIENTEDGE;
- style = WS_SYSMENU;
-
- AdjustWindowRectEx(&windowRect, style, false, exStyle);
-
- if(!(dummy = CreateWindowEx(exStyle,
- L"DummyWindow",
- L"Dummy Window",
- WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style,
- 0, 0,
- windowRect.right-windowRect.left,
- windowRect.bottom-windowRect.top,
- NULL, NULL,
- module,
- NULL)))
- {
- UnregisterClass(L"Dummy Window", module);
- return NULL;
- }
- ShowWindow(dummy, SW_HIDE);
-
- return dummy;
+ HMODULE module = GetModuleHandle(NULL);
+ HWND dummy;
+ RECT windowRect;
+ windowRect.left = 0;
+ windowRect.right = 8;
+ windowRect.top = 0;
+ windowRect.bottom = 8;
+
+ WNDCLASS wc;
+
+ wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
+ wc.lpfnWndProc = (WNDPROC) DefWindowProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = module;
+ wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hbrBackground = NULL;
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = L"DummyWindow";
+
+ if(!RegisterClass(&wc))
+ {
+ return 0;
+ }
+
+ DWORD style, exStyle;
+ exStyle = WS_EX_CLIENTEDGE;
+ style = WS_SYSMENU;
+
+ AdjustWindowRectEx(&windowRect, style, false, exStyle);
+
+ if(!(dummy = CreateWindowEx(exStyle,
+ L"DummyWindow",
+ L"Dummy Window",
+ WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style,
+ 0, 0,
+ windowRect.right-windowRect.left,
+ windowRect.bottom-windowRect.top,
+ NULL, NULL,
+ module,
+ NULL)))
+ {
+ UnregisterClass(L"Dummy Window", module);
+ return NULL;
+ }
+ ShowWindow(dummy, SW_HIDE);
+
+ return dummy;
}
void kill_dummy(HWND dummy) {
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<LinkIncremental>true</LinkIncremental>\r
+ <IncludePath>d:\libraries\glew\include;$(IncludePath)</IncludePath>\r
+ <LibraryPath>d:\libraries\glew\lib\;$(LibraryPath)</LibraryPath>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<LinkIncremental>false</LinkIncremental>\r
+ <IncludePath>d:\libraries\glew\include;$(IncludePath)</IncludePath>\r
+ <LibraryPath>d:\libraries\glew\lib\;$(LibraryPath)</LibraryPath>\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <AdditionalIncludeDirectories>..\..\include\core;..\..\include\xml;..\..\include\utils;..\..\include\config;..\..\include\views;..\..\src\core;..\..\include\images;..\..\include\effects</AdditionalIncludeDirectories>\r
+ <AdditionalIncludeDirectories>..\..\include\core;..\..\include\xml;..\..\include\utils;..\..\include\config;..\..\include\views;..\..\src\core;..\..\include\images;..\..\include\effects;..\..\include\gpu;..\..\gpu\include</AdditionalIncludeDirectories>\r
</ClCompile>\r
<Link>\r
<SubSystem>Windows</SubSystem>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <AdditionalDependencies>glew32.lib;opengl32.lib;d3d9.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<ClCompile>\r
<WarningLevel>Level3</WarningLevel>\r
- <PrecompiledHeader>Use</PrecompiledHeader>\r
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>\r
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <Optimization>MaxSpeed</Optimization>\r
+ <Optimization>Full</Optimization>\r
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <AdditionalIncludeDirectories>..\..\include\core;..\..\include\xml;..\..\include\utils;..\..\include\config;..\..\include\views;..\..\src\core;..\..\include\images;..\..\include\effects;..\..\include\gpu;..\..\gpu\include</AdditionalIncludeDirectories>\r
</ClCompile>\r
<Link>\r
<SubSystem>Windows</SubSystem>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<EnableCOMDATFolding>true</EnableCOMDATFolding>\r
<OptimizeReferences>true</OptimizeReferences>\r
+ <AdditionalDependencies>glew32.lib;opengl32.lib;d3d9.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
</Link>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<None Include="small.ico" />\r
</ItemGroup>\r
<ItemGroup>\r
+ <ClInclude Include="..\..\gpu\include\FlingState.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrAllocator.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrAllocPool.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrAPI.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrAtlas.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrClip.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrClipIterator.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrColor.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrConfig.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrContext.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrDrawTarget.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrFontScaler.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGLConfig.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGLIndexBuffer.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGLTexture.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGLVertexBuffer.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGlyph.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGpu.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrGpuVertex.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrIndexBuffer.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrInOrderDrawBuffer.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrInstanceCounter.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrIPoint.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrKey.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrMatrix.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrMemory.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrMesh.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrNoncopyable.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrPath.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrPathIter.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrPathSink.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrPlotMgr.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrPoint.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrRandom.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrRect.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrRectanizer.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrRefCnt.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrSamplerState.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrScalar.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrStopwatch.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrStringBuilder.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTArray.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTBSearch.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTDArray.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTextContext.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTextStrike.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTexture.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTextureCache.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTHashCache.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTLList.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTouchGesture.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrTypes.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrUserConfig.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrVertexBuffer.h" />\r
+ <ClInclude Include="..\..\gpu\include\GrVertexBufferAllocPool.h" />\r
+ <ClInclude Include="..\..\gpu\include\SkUIView.h" />\r
+ <ClInclude Include="..\..\gpu\src\GrGpuGL.h" />\r
+ <ClInclude Include="..\..\gpu\src\GrGpuGLFixed.h" />\r
+ <ClInclude Include="..\..\gpu\src\GrGpuGLShaders.h" />\r
+ <ClInclude Include="..\..\gpu\src\GrGpuGLShaders2.h" />\r
+ <ClInclude Include="..\..\gpu\src\GrQuadIndexTable.h" />\r
+ <ClInclude Include="..\..\gpu\src\GrTextStrike_impl.h" />\r
+ <ClInclude Include="..\..\include\gpu\SkGpuCanvas.h" />\r
+ <ClInclude Include="..\..\include\gpu\SkGpuDevice.h" />\r
+ <ClInclude Include="..\..\include\gpu\SkGr.h" />\r
+ <ClInclude Include="..\..\include\gpu\SkGrTexturePixelRef.h" />\r
+ <ClInclude Include="..\..\samplecode\SampleCode.h" />\r
<ClInclude Include="..\..\src\core\SkAntiRun.h" />\r
<ClInclude Include="..\..\src\core\SkBitmapProcShader.h" />\r
<ClInclude Include="..\..\src\core\SkBitmapProcState.h" />\r
<ClInclude Include="targetver.h" />\r
</ItemGroup>\r
<ItemGroup>\r
+ <ClCompile Include="..\..\experimental\SkSetPoly3To3.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrAllocPool.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrAtlas.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrClip.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrContext.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrDrawTarget.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGLIndexBuffer.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGLTexture.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGLVertexBuffer.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGpu.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGpuFactory.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGpuGL.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGpuGLFixed.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGpuGLShaders.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrGpuGLShaders2.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrInOrderDrawBuffer.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrMatrix.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrMemory.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrPath.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrPrintf_printf.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrRectanizer.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrTextContext.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrTextStrike.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrTextureCache.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\GrVertexBufferAllocPool.cpp" />\r
+ <ClCompile Include="..\..\gpu\src\gr_unittests.cpp" />\r
<ClCompile Include="..\..\samplecode\OverView.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleAll.cpp" />\r
<ClCompile Include="..\..\samplecode\SampleApp.cpp" />\r
<ClCompile Include="..\..\samplecode\SampleArc.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleAvoid.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleBitmapRect.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleBlur.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleCamera.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleCircle.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleCull.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleDecode.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleDither.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleDitherBitmap.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleDrawLooper.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleEffects.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleEmboss.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleExtractAlpha.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleFillType.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleFilter.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleFilter2.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleFontScalerTest.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleFuzz.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleGradients.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleHairline.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleLayerMask.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleLayers.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleLCD.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleLineClipper.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleLines.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleMeasure.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleMipMap.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleNinePatch.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleOverflow.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SamplePatch.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SamplePath.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SamplePathClip.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SamplePathEffects.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SamplePoints.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SamplePolyToPoly.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleRegion.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleRepeatTile.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleShaders.cpp" />\r
<ClCompile Include="..\..\samplecode\SampleShapes.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleSlides.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleStrokePath.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleStrokeText.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleText.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTextAlpha.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTextBox.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTextEffects.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTextOnPath.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTiling.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTinyBitmap.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleTypeface.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleVertices.cpp" />\r
+ <ClCompile Include="..\..\samplecode\SampleXfermodes.cpp" />\r
<ClCompile Include="..\..\src\core\Sk64.cpp" />\r
<ClCompile Include="..\..\src\core\SkAlphaRuns.cpp" />\r
<ClCompile Include="..\..\src\core\SkBitmap.cpp" />\r
<ClCompile Include="..\..\src\core\SkGlyphCache.cpp" />\r
<ClCompile Include="..\..\src\core\SkGraphics.cpp" />\r
<ClCompile Include="..\..\src\core\SkLineClipper.cpp" />\r
+ <ClCompile Include="..\..\src\core\SkMallocPixelRef.cpp" />\r
<ClCompile Include="..\..\src\core\SkMask.cpp" />\r
<ClCompile Include="..\..\src\core\SkMaskFilter.cpp" />\r
<ClCompile Include="..\..\src\core\SkMath.cpp" />\r
<ClCompile Include="..\..\src\core\SkRefCnt.cpp" />\r
<ClCompile Include="..\..\src\core\SkRegion.cpp" />\r
<ClCompile Include="..\..\src\core\SkRegion_path.cpp" />\r
+ <ClCompile Include="..\..\src\core\SkScalar.cpp" />\r
<ClCompile Include="..\..\src\core\SkScalerContext.cpp" />\r
<ClCompile Include="..\..\src\core\SkScan.cpp" />\r
<ClCompile Include="..\..\src\core\SkScan_Antihair.cpp" />\r
<ClCompile Include="..\..\src\effects\Sk1DPathEffect.cpp" />\r
<ClCompile Include="..\..\src\effects\Sk2DPathEffect.cpp" />\r
<ClCompile Include="..\..\src\effects\SkAvoidXfermode.cpp" />\r
+ <ClCompile Include="..\..\src\effects\SkBitmapCache.cpp" />\r
<ClCompile Include="..\..\src\effects\SkBlurDrawLooper.cpp" />\r
<ClCompile Include="..\..\src\effects\SkBlurMask.cpp" />\r
<ClCompile Include="..\..\src\effects\SkBlurMaskFilter.cpp" />\r
<ClCompile Include="..\..\src\effects\SkRectShape.cpp" />\r
<ClCompile Include="..\..\src\effects\SkTableMaskFilter.cpp" />\r
<ClCompile Include="..\..\src\effects\SkTransparentShader.cpp" />\r
+ <ClCompile Include="..\..\src\gpu\SkGpuCanvas.cpp" />\r
+ <ClCompile Include="..\..\src\gpu\SkGpuDevice.cpp" />\r
+ <ClCompile Include="..\..\src\gpu\SkGr.cpp" />\r
+ <ClCompile Include="..\..\src\gpu\SkGrFontScaler.cpp" />\r
+ <ClCompile Include="..\..\src\gpu\SkGrTexturePixelRef.cpp" />\r
<ClCompile Include="..\..\src\images\SkImageDecoder.cpp" />\r
<ClCompile Include="..\..\src\images\SkImageDecoder_Factory.cpp" />\r
<ClCompile Include="..\..\src\images\SkImageEncoder.cpp" />\r
<ClCompile Include="..\..\src\ports\SkThread_win.cpp" />\r
<ClCompile Include="..\..\src\ports\SkTime_win.cpp" />\r
<ClCompile Include="..\..\src\ports\SkXMLParser_empty.cpp" />\r
+ <ClCompile Include="..\..\src\utils\SkCamera.cpp" />\r
+ <ClCompile Include="..\..\src\utils\SkColorMatrix.cpp" />\r
+ <ClCompile Include="..\..\src\utils\SkCullPoints.cpp" />\r
<ClCompile Include="..\..\src\utils\SkDumpCanvas.cpp" />\r
<ClCompile Include="..\..\src\utils\SkParse.cpp" />\r
<ClCompile Include="..\..\src\utils\SkParsePath.cpp" />\r
+ <ClCompile Include="..\..\src\utils\SkUnitMappers.cpp" />\r
<ClCompile Include="..\..\src\utils\win\SkOSWindow_Win.cpp" />\r
<ClCompile Include="..\..\src\views\SkEvent.cpp" />\r
<ClCompile Include="..\..\src\views\SkEventSink.cpp" />\r
<ClCompile Include="..\..\src\views\SkMetaData.cpp" />\r
<ClCompile Include="..\..\src\views\SkOSMenu.cpp" />\r
<ClCompile Include="..\..\src\views\SkTagList.cpp" />\r
+ <ClCompile Include="..\..\src\views\SkTextBox.cpp" />\r
<ClCompile Include="..\..\src\views\SkView.cpp" />\r
<ClCompile Include="..\..\src\views\SkViewInflate.cpp" />\r
<ClCompile Include="..\..\src\views\SkViewPriv.cpp" />\r